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

Module build error when importing runtime code outside the runtime directory #375

Open
cjpearson opened this issue Sep 27, 2024 · 0 comments

Comments

@cjpearson
Copy link

We first noticed this issue when updating from 0.6.0 to 0.7.1.

If you are importing a function from the runtime directory into module.ts, it will fail if the full path to the file includes a period in the path. For example, in my case: /Users/connor.pearson/projects/my-module The directory with the period is parsed as the file instead of the actual file.

Sample reproduction: https://github.com/cjpearson/nuxt-module-builder-filename-issue

To run: yarn && yarn dev:prepare && yarn nuxt-module-build build

ERROR  Cannot find module /Users/connor.pearson/Downloads/filename-test/dist/runtime/utils/connor imported from file:///Users/connor.pearson/Downloads/filename-test, file:///Users/connor.pearson/Downloads/, file:///Users/connor.pearson/Downloads/filename-test/_index.js, file:///Users/connor.pearson/Downloads/node_modules

The project directory or one of its ancestors should include a "." in the path.

I've added an upstream issue here, but maybe this could be fixed by using basename here instead?

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

No branches or pull requests

1 participant