tauri-plugin-sql icon indicating copy to clipboard operation
tauri-plugin-sql copied to clipboard

TAURI with tauri-plugin-sql throws this error when invoking the plugin on the JAVASCRIPT side

Open emothek opened this issue 3 years ago • 1 comments

ERROR in ./src/App.js Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it) File was processed with these loaders:

  • ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
  • ./node_modules/babel-loader/lib/index.js
  • ./node_modules/source-map-loader/dist/cjs.js You may need an additional loader to handle the result of these loaders. Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it) at /home/mokhtar/restopos/node_modules/webpack/lib/dependencies/HarmonyDetectionParserPlugin.js:54:11 at Hook.eval [as call] (eval at create (/home/mokhtar/restopos/node_modules/tapable/lib/HookCodeFactory.js:19:10), :7:16) at Hook.CALL_DELEGATE [as _call] (/home/mokhtar/restopos/node_modules/tapable/lib/Hook.js:14:14) at JavascriptParser.walkAwaitExpression (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2314:29) at JavascriptParser.walkExpression (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2244:10) at JavascriptParser.walkVariableDeclaration (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2098:33) at JavascriptParser.walkStatement (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:1592:10) at JavascriptParser.walkStatements (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:1453:9) at JavascriptParser.parse (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:3338:9) at /home/mokhtar/restopos/node_modules/webpack/lib/NormalModule.js:1082:26 @ ./src/index.js 7:0-24 11:33-36

emothek avatar Feb 11 '22 15:02 emothek

@emothek can you please provide a reproducible example?

yankeeinlondon avatar Jul 21 '22 03:07 yankeeinlondon

Closing due to inactivity. The solution is probably to either wrap everything in an IIFE to simulate a top-level async function for vannilajs or to switch to Promise.then instead or whatever your frontend stack offers, anyway not really specific to the plugin,

FabianLars avatar Oct 23 '22 15:10 FabianLars