You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of warnings print in dev mode when using vite, and aren't printed in production based on my testing. While seemingly harmless, these warnings are noisy. It'd be better to use an approach in loaders that either doesn't attempt to access node, or the community finds a way to suppress them in vite. So far, I haven't figured out how to do this.
Vite does not automatically polyfill Node.js modules. We recommend avoiding Node.js modules for browser code to reduce the bundle size, although you can add polyfills manually.
vite build warnings:
Use of eval in "node_modules/@loaders.gl/worker-utils/dist/esm/lib/worker-farm/worker-body.js" is strongly discouraged as it poses security risks and may cause issues with minification.
"requireFromFile" is not exported by "__vite-browser-external", imported by "node_modules/@loaders.gl/worker-utils/dist/esm/lib/library-utils/library-utils.js".
"requireFromFile" is not exported by "__vite-browser-external", imported by "node_modules/@loaders.gl/worker-utils/dist/esm/lib/library-utils/library-utils.js".
"requireFromString" is not exported by "__vite-browser-external", imported by "node_modules/@loaders.gl/worker-utils/dist/esm/lib/library-utils/library-utils.js".
"requireFromString" is not exported by "__vite-browser-external", imported by "node_modules/@loaders.gl/worker-utils/dist/esm/lib/library-utils/library-utils.js".
Loaders Code
Examples of where loaders access node in try blocks:
A core part of the design philosophy of loaders.gl is that everything should works seamlessly both in browser and Node.
The main mechanism used to achieve this is the package.json browser field.
Bundlers are supposed to follow the file exclusion / substitution rules in the browser field when bundling.
However, esbuild only observes those rules in the top level package.json (so when loaders.gl is imported as libraries, the "browser" fields in the imported libraries get ignored.
AFAIK, vite used esbuild and so the loaders.gl node code is visible and we get these warnings.
I have kind of been hoping that esbuild would get around to fixing this but that is perhaps just wishful thinking.
A number of warnings print in dev mode when using
vite
, and aren't printed in production based on my testing. While seemingly harmless, these warnings are noisy. It'd be better to use an approach in loaders that either doesn't attempt to access node, or the community finds a way to suppress them invite
. So far, I haven't figured out how to do this.For more context see vitejs/vite#11877
Warnings
Browser console warnings:
docs link
vite build
warnings:Loaders Code
Examples of where loaders access node in
try
blocks:loaders.gl/modules/loader-utils/src/lib/node/stream.ts
Line 15 in dd88559
loaders.gl/modules/loader-utils/src/lib/node/fs.ts
Line 65 in dd88559
The text was updated successfully, but these errors were encountered: