-
Notifications
You must be signed in to change notification settings - Fork 97
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
Failed to resolve import #248
Comments
I'm having the same error in my This is my current solution: "scripts": {
"jiti-fix": "find ./dist -type f -exec sed -i '' 's|file://||g' {} \\;",
"dev": "unbuild --stub && npm run jiti-fix"
}, I can't pin down the issue why the |
I tried your solution on macOS too, the error gone from console but in localhost still got the same error |
Weird. I tried
|
I had this issue too and wrote a little unplugin yesterday to fix it in our app by transforming the |
hooks: {
'build:done': async ctx => {
// https://github.com/unjs/unbuild/issues/248
if (ctx.options.stub) {
fglob.sync('./dist/**/*.*js', { onlyFiles: true }).forEach(item => {
const filePath = path.resolve(__dirname, item);
fs.readFile(filePath, (err, data) => {
if (err) {
return err;
}
let str = data.toString();
str = str.replace(/file:\/\/\/(.+)/g, subStr =>
path.relative(path.resolve(filePath, '..'), url.fileURLToPath(subStr)).replace(/\\/g, '/')
);
fs.writeFile(filePath, str, err => {
if (err) return err;
});
});
});
}
}
}, |
Environment
node: v16.19.0
Reproduction
git clone https://github.com/gaetansenn/vunix
git checkout bugs/stub-symbol
yarn dev:nuxt-example
Describe the bug
I'm still facing a few problems with the build of my mono-repo project.
The first problem is with the dev build when using the --stub option of the https://github.com/unjs/unbuild
Here is the error when using the command: yarn dev:nuxt-example
The reproduction can be found on the branch: bugs/stub-symbol with yarn dev:nuxt-example command.
Additional context
My second problem is that, after updating the code on the branch bugs/stub-symbol, I encountered a problem with the Symbol() export used inside the @vunix/core package. It seems that the Symbol called from https://github.com/gaetansenn/vunix/blob/bugs/stub-symbol/packages/core/src/runtime/utils/config.ts#L175 is not returning the same symbol as the one used in https://github.com/gaetansenn/vunix/blob/bugs/stub-symbol/packages/core/src/runtime/components/elements/button/Button.vue#L66 I have added a comment to the latter version using a fixed string for the provide/inject.
Logs
No response
The text was updated successfully, but these errors were encountered: