Skip to content

fix: fix import absolute path support#720

Merged
Brooooooklyn merged 1 commit into
swc-project:masterfrom
yeliex:fix/import-absolute
Aug 17, 2023
Merged

fix: fix import absolute path support#720
Brooooooklyn merged 1 commit into
swc-project:masterfrom
yeliex:fix/import-absolute

Conversation

@yeliex

@yeliex yeliex commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

currently when import with absolute path, error shows:

node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:405:5)
    at new URL (node:internal/url:611:13)
    at fileURLToPath (node:internal/url:1399:12)
    at resolve (file:///xxx/node_modules/@swc-node/register/esm/esm.mjs:66:35)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:524:22)
    at importModuleDynamically (node:internal/modules/esm/translators:110:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
  input: '/Volumes/test/10_client.ts',
  code: 'ERR_INVALID_URL'
}

@CLAassistant

CLAassistant commented Aug 4, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yeliex yeliex force-pushed the fix/import-absolute branch from dc5125c to 808f4db Compare August 11, 2023 02:37
@yeliex yeliex force-pushed the fix/import-absolute branch from 808f4db to ffecee5 Compare August 11, 2023 02:41
@yeliex

yeliex commented Aug 11, 2023

Copy link
Copy Markdown
Contributor Author

@Brooooooklyn please review again, type bug fixed

@yeliex

yeliex commented Aug 17, 2023

Copy link
Copy Markdown
Contributor Author

@Brooooooklyn any feedback please
it is two weeks since pr create

if anything need improvement, leave your feedback

@Brooooooklyn Brooooooklyn merged commit fb71e52 into swc-project:master Aug 17, 2023
@yeliex yeliex deleted the fix/import-absolute branch August 17, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants