Danielduel
Danielduel•10mo ago

Deno+vite crashes on node dependency

Earlier today I was happy because everything worked on my m1 macbook. When I've returned home (arch) I got errors from latest deno... (I am running deno on the metal, but I will provide a way to reproduce it with docker:)
FROM denoland/deno:1.38.3

WORKDIR /app

RUN deno run --allow-read --allow-write --allow-env npm:create-vite-extra@latest vite-project --template deno-react

WORKDIR /app/vite-project
RUN deno task build
FROM denoland/deno:1.38.3

WORKDIR /app

RUN deno run --allow-read --allow-write --allow-env npm:create-vite-extra@latest vite-project --template deno-react

WORKDIR /app/vite-project
RUN deno task build
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getReport')
at isMusl (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:5:30)
at getPackageBase (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:53:28)
at Object.<anonymous> (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:28:21)
at Object.<anonymous> (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:81:4)
at Module._compile (node:module:733:34)
at Object.Module._extensions..js (node:module:747:10)
at Module.load (node:module:658:32)
at Function.Module._load (node:module:539:12)
at Module.require (node:module:677:19)
at require (node:module:791:16)
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getReport')
at isMusl (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:5:30)
at getPackageBase (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:53:28)
at Object.<anonymous> (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:28:21)
at Object.<anonymous> (file:///app/vite-project/node_modules/.deno/rollup@4.6.0/node_modules/rollup/dist/native.js:81:4)
at Module._compile (node:module:733:34)
at Object.Module._extensions..js (node:module:747:10)
at Module.load (node:module:658:32)
at Function.Module._load (node:module:539:12)
at Module.require (node:module:677:19)
at require (node:module:791:16)
9 Replies
Danielduel
Danielduel•10mo ago
Am I doing something in unintended way? (metal, interactive shell) import { join } from "node:path" join works like expected (rollup native.js uses const { platform, arch, report } = require('node:process'); so in interactive shell I did import { report } from "node:report" report is undefined
marvinh.
marvinh.•10mo ago
@Danielduel Can you file an issue for that? That sounds like a bug in Deno https://github.com/denoland/deno/issues/new
marvinh.
marvinh.•10mo ago
Went ahead and pasted the messages into an issue. https://github.com/denoland/deno/issues/21355
GitHub
node: process.report is missing · Issue #21355 · denoland/deno
Reported on discord: Earlier today I was happy because everything worked on my m1 macbook. When I've returned home (arch) I got errors from latest deno... (I am running deno on the metal, but I...
Danielduel
Danielduel•10mo ago
Thank you @marvinh., do I have to do anything now?
marvinh.
marvinh.•10mo ago
no, someone of the cli team will take a look at that issue. There is enough information in there to debug it
Danielduel
Danielduel•10mo ago
Thank you ^^ @bartlomieju thanks for the quick response, I suggest doing it in 2 parts - first just to make vite run with most of stuff stubbed in the polyfill and 2nd part to make actual implementation of the report object
bartlomieju
bartlomieju•10mo ago
Yup, that's a good approach!
Danielduel
Danielduel•10mo ago
I miss a detail here - despite I've built deno with an implementation of report in process... importing "node:process" still fetches it from the remote
Danielduel
Danielduel•10mo ago
GitHub
fix(ext/node): add stubbed process.report by Danielduel · Pull Requ...
targets #21355, #21304 Issues with vite are caused by the missing node's process report object. I've stubbed most of it for starter and replaced trivial spots with stubs. I am not sure how ...