New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module parse failed: Cannot use keyword 'await' outside an async function (8:0) #287
Comments
Your best bet is to downgrade to before v4.0.0 "curlconverter": "^3.21.0", But also, can you tell me which version of Node.js you're using (
|
node --version |
This comment was marked as outdated.
This comment was marked as outdated.
The new curlconverter 4 pre-release supports Node 12 once again, so this shouldn't be an issue anymore. |
Hi I am facing this issue for node version 14.18.0 in a react project, any possible resolution? |
If you're using Webpack to build your project, please take a look at how we use Webpack to build the curlconverter.com website. For this error, you have to add this to your webpack.config.js file experiments: {
topLevelAwait: true
}, |
I don't see a webpack.config.js file in my project, should I create one? |
How are you running your project? |
I am using this script to run my project: react-scripts start |
@soham-sagade you're using |
Same issue here using Node 18.9.0 with Vite. |
@amorin-gladia for Vite you can do this configureWebpack: {
experiments: {
topLevelAwait: true
},
}, but I think this requires Vite 3 because it has Webpack 5. I don’t want to remove it because then all the functions would have to be async, except the Node version of the library doesn’t need the |
error in ./node_modules/curlconverter/util.js
Module parse failed: Cannot use keyword 'await' outside an async function (8:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| // Top-level await is not available in Safari until 15 (TP)
@ ./node_modules/curlconverter/generators/ansible.js 1:0-34 20:18-39
@ ./node_modules/curlconverter/index.js
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/general_tools/curl_tools/index.vue?vue&type=script&lang=js&
@ ./src/views/general_tools/curl_tools/index.vue?vue&type=script&lang=js&
@ ./src/views/general_tools/curl_tools/index.vue
@ ./src/views sync ^./.*$
@ ./src/store/modules/permission.js
@ ./src/store/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://172.17.12.166:80&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
The text was updated successfully, but these errors were encountered: