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
As part of prototyping support for #1143 and #1322, a standard conventions is emerging where-in this runtimes and platforms expect explicit resolution prefixes for NodeJS built-ins (and to a degree node_modules). Otherwise errors will occur along the lines of the below
Found Functions directory at /functions. Uploading.
13:29:46.090 ⛅️ wrangler 3.76.0
13:29:46.090 -------------------
13:29:47.862 ✘ [ERROR] Could not resolve "fs"
13:29:47.863
13:29:47.863 api/fragment/fragment.js:1:15:
13:29:47.863 1 │ import fs from 'fs';
13:29:47.863 ╵ ~~~~
13:29:47.863
13:29:47.863 The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
Details
A basic example of this would be possible using Rollup (though directly supported by Greenwood)
// this ensure things like fs -> node:fsexportfunctionnamespaceNodeSpecifiers(options={}){constnodeSpecifiers=['fs'];return[{type: 'rollup',name: 'plugin-namespace-node-specifiers',provider: ()=>[{name: 'namespace-node-specifiers',asyncresolveId(id){if(nodeSpecifiers.includes(id)){return{id: `node:${id}`,external: true};}}}]}];};
Might also need to something similar for node_modules as well, e.g. bare specifier
import{renderToHTML}from'npm:wc-compiler'
Should we make this configurable?
The text was updated successfully, but these errors were encountered:
Type of Change
Enhancement
Summary
As part of prototyping support for #1143 and #1322, a standard conventions is emerging where-in this runtimes and platforms expect explicit resolution prefixes for NodeJS built-ins (and to a degree node_modules). Otherwise errors will occur along the lines of the below
Details
A basic example of this would be possible using Rollup (though directly supported by Greenwood)
Might also need to something similar for node_modules as well, e.g. bare specifier
Should we make this configurable?
The text was updated successfully, but these errors were encountered: