-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
Yarn's link protocol status & other resolve problems #9139
Comments
Hello @kubijo, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by |
hi @kubijo problem 1i have tried link protocol in my local env, i can't find any problem. And in my opinion , the link protocol is the responsibility of package manager not bundler. problem 2it looks like a bug, but the log does not provide much clues, a reproduction example is also needed. problem 3in my local reproduce, import { Information } from "@carbon/react" // 1.75.0 will emit the error with both rspack(@1.1.8) and webpack(@5.97.1) import { Information } from "@carbon/react/icons" work with rspack , but does not working with webpack so i need another reproduction. |
Webpackyarn run build-webpack {
entry: '/home/pepa/dev/rspack-link/packages/foo/index.js',
output: {
filename: 'index.js',
path: '/home/pepa/dev/rspack-link/out/webpack'
},
module: {
rules: [
{
test: /\.(?:js|mjs|cjs)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: { targets: 'defaults', presets: [ [ '@babel/preset-env' ] ] }
}
}
]
}
}
RspackJust two errors picked here, the whole thing is too big to fit yarn run build-rspack {
entry: '/home/pepa/dev/rspack-link/packages/foo/index.js',
output: {
filename: 'index.js',
path: '/home/pepa/dev/rspack-link/out/webpack'
},
module: {
rules: [
{
test: /\.js$/,
use: [
{
loader: 'builtin:swc-loader',
options: { jsc: { parser: { syntax: 'ecmascript' } } }
}
]
}
]
}
}
|
Oh, forgot the link... here: https://github.com/kubijo/rspack-link-repro |
Now, one thing to note here that surprised me was a problem with ESM. When I set up the repro as we have it in the other project, it didn't work without explicit extensions in the imports. This surprised me quite a lot because we use extension-less imports in that project… but perhaps that is solved by some plugin in either webpack or babel ... or maybe in typescript? I obviously tried to make as minimal repro as possible, so I opted to skip typescript and any plugins. It is however nice that webpack at least tells me that this bothers it, rspack is quiet about it.
{
entry: '/home/pepa/dev/rspack-link/packages/foo/index.js',
output: {
filename: 'index.js',
path: '/home/pepa/dev/rspack-link/out/webpack'
},
module: {
rules: [
{
test: /\.(?:js|mjs|cjs)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: { targets: 'defaults', presets: [ [ '@babel/preset-env' ] ] }
}
}
]
}
}
|
As for the Is there any way for me to poke at something to inspect stuff while it's trying to print it? Somewhere you are casting something to string and the project is too complex to know off-hand what this could result from. The Worst-case scenario, I do have rust setup on my end and could also try to poke at that if you tell me what, where and how... |
@kubijo tough problem, it takes time; digging with rspack-resolve 💪 |
Hello. Since you landed the built-in Yarn PNP support, I tried to revisit replacing our webpack setup by RSpack, but it appears that it's still not working as expected.
1) is the link protocol supposed to work?
It doesn't seem so because I'm just getting errors that those dependencies cannot be found.
We are using those to clean up long relative imports in monorepo…
package.json
2) Unknown
[object Object]
warnings3) 3rd party module imports broken
@carbon/react
package, not…/icons
The text was updated successfully, but these errors were encountered: