Cannot deploy Nuxt app to pages. Build completes, but after publish I get a minified runtime error

my pages.dev link : woom-v2-nuxt3-cloudflare-autodeploy.pages.dev deployment id : 0ac92c74-e72e-4969-8256-1fcedfbba7ee I am consistently getting a runtime error after the publish succeeds. Given that the error is coming from minified js, that I do not have access to, this is making it impossible to figure out exactly what the problem is. 2:46:05.130 Success: Assets published! 12:46:06.565 Error: Failed to publish your Function. Got error: Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at functionsWorker-0.8391131841286965.js:21419:92 when I build and run using wrangler locally, I get a similar error service core:user:worker: Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at bh25zprwrab.js:21509:92 ✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above. However I can never find the file it refers to [bh25zprwrab.js in this case] any help would be greatly appreciated
4 Replies
crossbeau
crossbeau10mo ago
I ran into this the other day. I unminified and dug into the _worker.js with my nitro preset with minify false and then tracked down the erroring code… so in your case line 21509 I did that to mine and determined the code was associated with a library i did not need and it was baked into a server side library i wasnt using
Garnaph
Garnaph10mo ago
@.crossbeau thanks for this. Can you tell me where the setting is in config to switch minify to false? I can probably find it myself, but I've had trouble in the past where google says something is in 3 places, and none of them work facesad
reitznerdomenik
reitznerdomenik10mo ago
👋 also following this issue 😉
Garnaph
Garnaph10mo ago
OK, finally figured this out. wrangler/miniflare places build outputs in your /tmp folder. The output js file ends up in a few locations : The one in the root of /tmp is smaller, with include references. The one in a sub-directory of /tmp has the imports included in the single file. This is the one where I was able to finally find the offending line. In this case, it ended up being the vue-i18n library I was using. I bumped it to the latest beta version, and the error went away.
Want results from more Discord servers?
Add your server
More Posts
websocket proxy servercan we create a forward websocket proxy server in worker? is there any example?When I want to register a low priceWhen I want to register a low-price domain, is there a way to see a list of domain extensions *with[ERROR] Could not resolve "node:buffer"Hello, I'm having some issues with building my worker using: ``` compatibility_flags = [ "nodejs_comwww CNAME not properly resolving to my Pages domain - Error code 522I have a pages project up at https://rexipie.pages.dev. A while back I used Cloudflare domains to haSSL Error due to missing root CA for AWS domain with root CNAME to PagesHi all! I have a domain registered on AWS route 53, let's call it `example.com`. The content of thEndpoint working on preview but not via browser?Hi there! I'm having some problems with my worker instance, the endpoint seems to be working on the I get error: You have no linked accounts matching the provided username. (Code: 8000011)I own a static website made out of HTML + CSS + JS. I've used CloudFlare Pages for some time now andWhen syncing fork CF did not auto deploy the pageAfter syncing my fork via the Github website, CF still thinks the latest commit is whatever was befoChange POST request to GET request using workers for the same url.is there a way to change the request method from post to get for the same request object, using worktry https dl1 tanphongthan com versiontry https://dl1.tanphongthan.com/version.json vs https://dl2.tanphongthan.com/version.json response