Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop command fails on creating import map with Failed to parse URL error (Node >= 18.19.0) #1190

Closed
thescientist13 opened this issue Dec 19, 2023 · 0 comments · Fixed by #1191
Assignees
Labels
bug Something isn't working CLI v0.29.1
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 19, 2023

Summary

Observed in #1186 that GitHub actions had started failing all of a sudden

TypeError: Failed to parse URL from file://file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/lit-html/lit-html.js.map
    at new Request (node:internal/deps/undici/undici:5272:19)
    at NodeModulesResource.resolve (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/plugins/resource/plugin-node-modules.js:41:12)
    ... 5 lines matching cause stack trace ...
    at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37
    at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37
    at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37 {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:405:5)
      at new URL (node:internal/url:676:13)
      at new Request (node:internal/deps/undici/undici:5270:25)
      at NodeModulesResource.resolve (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/plugins/resource/plugin-node-modules.js:41:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:44:29
      at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37
      at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37
      at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37
      at async file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lifecycles/serve.js:42:37 {
    input: 'file://file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/lit-html/lit-html.js.map',
    code: 'ERR_INVALID_URL'
  }
}

Details

Upon further inspection of the issue, turns out is due to this code we had in place to leverage import.meta.resolve that is now activated when running on Node 18.19.0, which is when this feature is first getting introduced now. But clearly the implementation is broken 🤦‍♂️

There is a ticket I had tracking for integrating #684 in as many places as possible, and now fixing the original implementation, but will take a little bit of time. (I tried quickly seeing if I could get compat with import.meta.resolve but it was starting to go down a rabbit hole 🐰 )

I think the plan here will be to remove the import.meta.resolve code so we can at least ensure Greenwood can run properly, and we will refactor to use import.meta.resolve as we approach 1.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI v0.29.1
Projects
1 participant