-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Relative asset plugin broken #13439
Comments
Seeing this issue also |
Would you provide a reproduction? 🙏 |
@danielroe please check also unocss/unocss#676 the error looks similar |
I have the same problem, but it looks like it only happens on the / route, not in the others |
seems to happen on this commit precisely: nuxt/framework@a0f8a44 |
got the same issues in preview mode but not with the route but with the component |
hashes match is true |
is there a workaround for now or proposed fix to wait on? |
@peteromano for now you can use |
This is my temporary solution
~/deploy.mjs import fs from 'node:fs/promises';
import path from 'node:path';
const p = "/_nuxt/"
const __dirname = new URL(".",import.meta.url).pathname
const from = path.resolve(__dirname,".output/public"+p)
try {
let files = await fs.readdir(from)
files = files.filter(v=>v.startsWith("entry-") && v.endsWith(".mjs"))
if (files.length) {
const file = path.resolve(from,files[0])
let data = await fs.readFile(file,{encoding:"utf-8"})
const replace = []
const regex = /import\("(.*?)\.mjs"\)/gm
let match = undefined
data = data.replaceAll("./","")
for (;;) {
match = regex.exec(data)
if(match===null) break
replace.push(match[1])
}
replace.forEach(v=>{
const css = new RegExp(v.slice(0,v.indexOf("-"))+"\.(.{8})\.css")
data = data.replaceAll(v+".mjs",path.resolve(p,v+".mjs"))
data = data.replace(css,p+"$&")
})
await fs.writeFile(file,data)
}
} catch(e) {
console.error(e)
} |
This release did resolve it for me for now.
|
This worked for me. Thanks! |
@bmhtech07 This bug should not be present in the current version of Nuxt. If it is, would you open a new issue with a reproduction? |
False alarm. Staging branch hadn't been updated! Now fine! |
@danielroe it seems to be present again in |
@ennioVisco Would you open a new issue with a reproduction? |
Environment
window10
nodejs: v16.14.0
Reproduction
GET http://localhost:3000/main-62bdb63b.mjs net::ERR_ABORTED 404 (Page not found: /main-62bdb63b.mjs)
GET http://localhost:3000/main.4f570753.css net::ERR_ABORTED 404 (Page not found: /main.4f570753.css)
entry-dfffb6f1.mjs:8 Event {isTrusted: true, type: 'error', target: link, currentTarget: link, eventPhase: 2, …}
Uncaught (in promise) Event {isTrusted: true, type: 'error', target: link, currentTarget: null, eventPhase: 0, …}
Describe the bug
When I'm routing to a certain page,for example:
router.push({ name: 'main'}),
then report the above error
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: