-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
esm output provides wrong import statement #1212
Comments
Hey, this is expected behavior of the plugin, but since If a quick fix is needed, you can add this line to the file:
|
I cannot build the package with esbuild because of this issue
|
For esbuild, i've redirected imports to umd and it seems to work const resolveFixup = {
name: 'resolve-fixup',
setup(build) {
build.onResolve({ filter: /react-virtualized/ }, async args => {
return {
path: path.resolve('./node_modules/react-virtualized/dist/umd/react-virtualized.js'),
}
})
},
};
esbuild.build({
plugins: [
resolveFixup,
// your plugins
],
}); |
@YurySolovyov This is a good patch fix for this issue, but this needs to be resolved in a later release of |
For anyone using Vite v2.3.0 or newer, you can apply the esbuild plugin that @YurySolovyov wrote above by modifying your Vite config to include the following: export default defineConfig({
optimizeDeps: {
esbuildOptions: {
plugins: [resolveFixup]
}
}
}); |
This problem also happens when building with |
This is still an issue for us when building with esbuild. |
Yeh, I worked through several issues I had trying out esbuild and using a lerna monorepo, and after all those were resolved I hit this. Bumping this in hopes it gets attention. :-) |
@intafon if you need a quick fix #1212 (comment) solution worked for me. In terms of this being fixed in general, it's already been fixed and merged but it seems to be stuck on being published. 2e962d8 |
It's still an issue in 2023 vite v4.3.8 |
Also hitting this issue. Please fix! |
Hotfix for this issue has been resolved above at the comment |
I wrote an esbuild plugin to fix this: https://npmjs.com/package/esbuild-plugin-react-virtualized |
There is in the end unused and not existing import. Seems like generated by mistake
https://unpkg.com/[email protected]/dist/es/WindowScroller/utils/onScroll.js
/cc @brigand
The text was updated successfully, but these errors were encountered: