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
Critical dependency: the request of a dependency is an expression #249
Comments
I think I need to update the yargs package dependency inside curlconverter. In the meantime you can suppress the warning in webpack config: ivan-aksamentov/reactlandia-bolerplate-lite#5 (comment) |
Thanks, @NickCarneiro! I cloned the project, tried to upgrade yargs to the latest version, but the tests didn't pass because some new characters are added to the actual response (%22, %27, \', ...) for example (python) post with urlencoded data: |
Here is the yargs patch on my fork. yargs/yargs@master...NickCarneiro:master |
I make some changes in curlconverter and yargs-parser (split from yargs to another package). |
Great work. I've published a new version (3.13.0) that references your fork of yargs-parser. Does this fix the warning for you? |
Unformentualy not, I'm getting an new error and when I trying to fix it by install @babel/plugin-syntax-import-meta, another issue occurs.
|
Here is what I'm seeing from a clean install in a fresh directory.
|
@NickCarneiro Same issue:
|
@NickCarneiro this is actually not resolved. Did you find the time to have a look into it and have an update for us? |
@sPaCeMoNk3yIam we just released 3.20.0 which fixed some issues with installing. Can you please check that this issue is still happening? If this is still a problem, please post the exact commands that I need to run to get this error, similar to how Nick posted the exact commands he ran in #249 (comment) to show you that he is able to install it without any errors. |
version: 3.21.0 node -version 14.17.6 Failed to compile. ./node_modules/@curlconverter/yargs/lib/platform-shims/esm.mjs 18:41
|
How are you compiling your code? |
This is a Vue project【@vue/cli 4.5.10】 node -v curlconverter【3.21.0】 1、vue create demo |
After running these commands:
Then making this my const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: {
fallback: {
"util": require.resolve("util/"),
"assert": require.resolve("assert/"),
"path": require.resolve("path-browserify"),
"url": require.resolve("url/"),
"fs": false
}
}
}
}) then running
I also see this warning:
When I open the site in my browser though, I see this error in the console:
Looking at the code it's trying to access I tried doing const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack');
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
})
],
resolve: {
fallback: {
"util": require.resolve("util/"),
"assert": require.resolve("assert/"),
"path": require.resolve("path-browserify"),
"url": require.resolve("url/"),
"fs": false
}
}
}
}) and got this error
which looks like it might be doing plugins: [
new webpack.DefinePlugin({
'process': null,
})
], and it errored somewhere else, so this is a dead end. I came across https://github.com/yargs/yargs/blob/main/docs/browser.md which suggests that if you want to use yargs in the browser, you have to import a different thing than if you import it from node. So it looks like curlconverter 3 has been un-runnable in the browser since whichever version upgraded yargs to this version that doesn't work in the browser. I assume this used to work. curlconverter 4 doesn't use yargs anymore. You have to copy files from the node_modules/ folder to get it to work, you can see how we do that with webpack for the production website here: https://github.com/curlconverter/curlconverter.github.io/blob/d98b376dd538e8af54934461447099534f27db24/webpack.config.js#L53-L54 We could do something similar to what we do with curlconverter 4, where we have 2 different files for loading the node or the web version of the bash parser here and then use Line 80 in 85403b7
if that's possible. Then we'd have to release a 3.22.0. Fortunately, I got curlconverter 4 working with Vue, I had to do this in my vue.config.js const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack');
const CopyPlugin = require("copy-webpack-plugin")
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
experiments: {
topLevelAwait: true
},
plugins: [
new CopyPlugin({
patterns: [
{from: 'node_modules/web-tree-sitter/tree-sitter.wasm', to: 'js'},
'node_modules/curlconverter/dist/tree-sitter-bash.wasm'
]
})
],
resolve: {
fallback: {
// I don't know which (if any) of these are necessary
"util": require.resolve("util/"),
"assert": require.resolve("assert/"),
"path": require.resolve("path-browserify"),
"url": require.resolve("url/"),
"fs": false
}
}
}
}) and then I was able to
in App.vue. |
Hello, I'm getting this warning when using curlconverter dependency.
Any idea how to solve it?
The text was updated successfully, but these errors were encountered: