Open joonjeong opened 1 year ago
This could be due to #81 as I saw the same error. You're probably seeing this error because your asset name in your vite manifest is actually assets/main-130a948e.js
but the slash is being prepended.
If you can use the code on master
it will verify if this is the problem.
I have this vite.config.js
const rollupOptions = {
input: {
main: resolve("./src/assets/main.js"),
},
output: {
entryFileNames: "[name].js",
chunkFileNames: undefined,
assetFileNames: '[name][extname]'
},
};
module.exports = {
plugins: [],
root: resolve("./src/assets"),
base: "/static/",
assetsDir: "public",
resolve: {
extensions: [".js", ".json"],
},
build: {
outDir: resolve("./src/mpm/static"),
manifest: true,
target: "es2015",
sourcemap: true,
rollupOptions
},
};
Notice how the hash is removed. It build this manifest:
{
"main.js": {
"file": "main.js",
"src": "main.js",
"isEntry": true,
"css": [
"main.css"
]
},
"main.css": {
"file": "main.css",
"src": "main.css"
}
}
And I'm linking the stylesheet as :
<link rel="stylesheet" href="{% vite_asset_url 'main.css' %}">
Which works on on development mode. But fails in production mode with the same error than OP. I'll create a separate issue if needed. But the error is exact the same:
File "/usr/local/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py", line 513, in stored_name
raise ValueError(
ValueError: Missing staticfiles manifest entry for 'main.css'
Hi, I'd like to report error after upgrade django-vite.
Previously, I've been used 2.0.2 version and I recently upgrade django-vite to 2.1.2. After I upgrade, I'm meeting Missing staticfiles manifest entry error like this.