-
Notifications
You must be signed in to change notification settings - Fork 12
Labels
CLIInitPluginsGreenwood PluginsGreenwood PluginsRuntimesTasks related to supporting runtimes like Deno, Bun, etcTasks related to supporting runtimes like Deno, Bun, etcalpha.3enhancementImprove something existing (e.g. no docs, new APIs, etc)Improve something existing (e.g. no docs, new APIs, etc)good first issueGood for newcomersGood for newcomersv0.33.0
Milestone
Description
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
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
We would want to go through the codebase and make sure all Node builtins are using the node:
prefix, e.g.
// before
import fs from 'fs';
// after
import fs from 'node:fs';
It might be worth adding the eslint-plugin-import plugin to the project with the node protocol rule set to always.
It also suggests pairing that plugin with the node-version setting, but can it support >=
? What version would we set it to?
Metadata
Metadata
Assignees
Labels
CLIInitPluginsGreenwood PluginsGreenwood PluginsRuntimesTasks related to supporting runtimes like Deno, Bun, etcTasks related to supporting runtimes like Deno, Bun, etcalpha.3enhancementImprove something existing (e.g. no docs, new APIs, etc)Improve something existing (e.g. no docs, new APIs, etc)good first issueGood for newcomersGood for newcomersv0.33.0
Type
Projects
Status
✅ Done