-
Notifications
You must be signed in to change notification settings - Fork 480
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
nitro build for edge presets should use browser target #410
Comments
Another guess on the issue would be that nitro does not properly respect the browser field in the modules package.json "browser": {
"asciify-image": false,
"./src/node/node-asciify-image.ts": false,
"./dist/node/node-asciify-image.js": false,
"./dist/es5/node/node-asciify-image.js": false,
"./dist/esm/node/node-asciify-image.js": false
}, For node based presets the browser field is not really relevant but web workers should probably respect it? The browser excluded files also correlate with the error message hence the guess. Anyways, if theres anything else I can do, please let me know as getting this running is the last thing atm that's blocking us from migrating to nuxt 3❤ |
Running into the same issue with deck.gl and cloudflare workers at the moment, did you happen to find any workaround @warflash? |
I did not no. Just gotta wait and hope it's something that can be resolved soon I guess🤞 |
Small update, due to changes in either a nuxt or nitro release there is now warnings being logged before the build:
Still only edge deploys are failing, node.js targets build fine 🤔 |
https://stackblitz.com/edit/github-dfijad-x7236k?file=nuxt.config.ts,app.vue,package.json Same issue with mongodb and aws-sdk packages as well which have require inside of a try catch block. |
A workaround for this issue is to use the alias option in |
This is on our radar, let's track with #1371 |
Environment
nitro
0.4.18
Reproduction
Bridge: https://stackblitz.com/edit/github-mdiu2d?file=pages%2Findex.vue
Nuxt 3: https://stackblitz.com/edit/github-ouxssx?file=nuxt.config.ts
npm run build
Describe the bug
Building the nitro server fails for edge deploy targets such as
cloudflare
in this particular reproduction.Error:
Rollup error: Cannot resolve "asciify-image" from "/home/projects/github-mdiu2d/node_modules/@probe.gl/log/dist/es5/node/node-asciify-image.js" and externals are not allowed!
Choosing a deploy target other then edge makes the issue disappear
Additional context
The probe.gl library used here wraps
module.require()
inside of a try catch block which I suspect might be causing the issue in nitro.https://github.com/uber-web/probe.gl/blob/master/modules/log/src/node/node-asciify-image.ts
Logs
No response
The text was updated successfully, but these errors were encountered: