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

test(environment): reproduce custom environment registerMissingImport error #16426

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Apr 15, 2024

Description

reproduction for registerMissingImport error in custom environment

$ node playground/environment-custom/src/test-esm-dep.mjs 
[vite] connected.
Forced re-optimization of dependencies
[vite] connected.
Forced re-optimization of dependencies
[vite] connected.

file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:8900
            throw new Error(`Vite Internal Error: registerMissingImport is not supported in dev ${environment.name}`);
                  ^

Error: Vite Internal Error: registerMissingImport is not supported in dev custom
    at Object.registerMissingImport (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:8900:19)
    at tryNodeResolve (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:16077:45)
    at Context.resolveId (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:15716:28)
    at async Object.resolveId (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:13893:32)
    at async EnvironmentModuleGraph._resolveUrl (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:9295:46)
    at async EnvironmentModuleGraph.getModuleByUrl (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:9028:23)
    at async doTransform (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:5898:18)
    at async fetchModule (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:8356:18)
    at async ModuleRunner.cachedModule (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/module-runner.js:926:91)
    at async ModuleRunner.import (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/module-runner.js:850:27)

Node.js v20.12.2

Copy link

stackblitz bot commented Apr 15, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev
Copy link
Member

Thanks for the report! I'm working on some bigger changes to the implementation now that may fix this one. If not, I'll get to it after I complete the iteration.

@patak-dev patak-dev deleted the branch vitejs:feat/environment-api April 19, 2024 12:42
@patak-dev patak-dev closed this Apr 19, 2024
@hi-ogawa hi-ogawa deleted the test-environment-custom-import-deps branch April 19, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants