Skip to content
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

Upgrading to the latest version 4.1.0 is not compatible with *.mjs files. #59

Open
ChrisGao2016 opened this issue Dec 10, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ChrisGao2016
Copy link

Our project uses [email protected] and imports the xlsx.mjs file. However, beginning with version 4.1.0, the dependency switched to node-stdlib-browser, causing the buffer to downgrade to version 5.x. The buffer 5.x version only includes the common module, which is not compatible with the project's reference to *.mjs files, leading to webpack build errors.

@Richienb Richienb added the bug Something isn't working label Dec 10, 2024
@Richienb
Copy link
Owner

@ChrisGao2016 [email protected] also seems to use commonjs. Are you sure your issue is resolved by downgrading to [email protected]?

Maybe there's a different cause?

@Richienb
Copy link
Owner

@niksy Worth updating the buffer package anyways?

@niksy
Copy link

niksy commented Dec 10, 2024

Let’s see if this really is issue with buffer module, but I don’t see why not, except I would like to bump it to major version. I’m not sure if this can break other dependants.

@gabrielbarretoo
Copy link

Same bug here. Any solution?

@Rukato
Copy link

Rukato commented Jan 10, 2025

I was able to solve the issue by setting the yaml inter-dependency version to the latest. This solved the issue of the breaking change where it could not find an index.js file. The error I was seeing was:

ERROR in ./node_modules/yaml/browser/dist/warnings-df54cb69.js 24:15-21 Module not found: Error: Can't resolve '[workspace/project]/node_modules/buffer' in '[workspace/project]/node_modules/yaml/browser/dist' Did you mean 'index.js'? BREAKING CHANGE: The request '[workspace/project]/node_modules/buffer' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. resolve '[workspace/project]/node_modules/buffer' in '[workspace/project]/node_modules/yaml/browser/dist' using description file: [workspace/project]/node_modules/yaml/browser/dist/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration root path [workspace/project] using description file: /[workspace/project]/package.json (relative path: .[workspace/project]/node_modules/buffer) Field 'browser' doesn't contain a valid alias configuration [workspace/project]/[workspace/project]/node_modules/buffer doesn't exist using description file: [workspace/project]/package.json (relative path: ./node_modules/buffer) Field 'browser' doesn't contain a valid alias configuration [workspace/project]/node_modules/buffer is not a file @ ./node_modules/yaml/browser/dist/index.js 5:0-51 978:11-15 @ ./node_modules/yaml/browser/index.js 1:0-39 @ ./node_modules/redoc/bundles/redoc.browser.lib.js 2:92854-92869 @ ./src/pages/docs/api_docs.tsx 3:0-40 14:84-99 @ ./src/AuthApp.tsx 14:0-48 28:144-151 @ ./src/App.tsx 10:0-32 19:36-43 @ ./src/index.tsx 3:0-24 6:73-76

I was able to solve it by setting this on my package.json
"resolutions": { "buffer": "6.0.3", "yaml":"2.7.0" },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants