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

Rollup failed to resolve image absolute path on build #70

Open
techieoriname opened this issue Dec 4, 2021 · 5 comments
Open

Rollup failed to resolve image absolute path on build #70

techieoriname opened this issue Dec 4, 2021 · 5 comments

Comments

@techieoriname
Copy link

Currently when I run build I run into a rollup import error.

[vite]: Rollup failed to resolve import "/logo.svg" from "src/components/Footer.vue".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
/vite-edge/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:43253
            throw new Error(`[vite]: Rollup failed to resolve import "${id}" from "${importer}".\n` +
                  ^

Error: [vite]: Rollup failed to resolve import "/logo.svg" from "src/components/Footer.vue".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

This works when running dev, but not when running build, but when I switch to relative path, build runs perfectly.
And vite warning is on when using relative path for dev.

@frandiox
Copy link
Owner

frandiox commented Dec 5, 2021

I think I've seen this before. Can you try this? frandiox/vite-ssr#85 (reply in thread)

@techieoriname
Copy link
Author

I think I've seen this before. Can you try this? frandiox/vite-ssr#85 (reply in thread)

I'm getting this error, and when I suppress using @tsignore it still shows the error

Type 'true' is not assignable to type 'string | false | undefined'.

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vitedgePlugin from "vitedge/plugin.js";
import viteSSR from "vite-ssr/plugin.js";

export default defineConfig({
    plugins: [
        vitedgePlugin(),
        viteSSR({
            build: {
                serverOptions: {
                    publicDir: true
                }
            }
        }),
        vue()
    ],
})

@frandiox
Copy link
Owner

frandiox commented Dec 5, 2021

@techieoriname ah just noticed an error in the post. Try 'public' instead of true.

@techieoriname
Copy link
Author

@techieoriname ah just noticed an error in the post. Try 'public' instead of true.

🤔 Still experiencing same error

@techieoriname
Copy link
Author

no head way yet on this 🥺

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

2 participants