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

nuxt3-rc generate and url is not relative Url #13780

Closed
mlsjla opened this issue Apr 21, 2022 · 7 comments · Fixed by nuxt/framework#5398
Closed

nuxt3-rc generate and url is not relative Url #13780

mlsjla opened this issue Apr 21, 2022 · 7 comments · Fixed by nuxt/framework#5398

Comments

@mlsjla
Copy link

mlsjla commented Apr 21, 2022

Environment

Nuxt CLI v3.0.0-rc.0-27508091.78fcbcf 10:48:08
RootDir: /Users/mac/.webcode/gin-nuxt/web 10:48:11
Nuxt project info: 10:48:11


  • Operating System: Darwin
  • Node Version: v16.14.0
  • Nuxt Version: 3.0.0-rc.0-27508091.78fcbcf
  • Package Manager: npm@8.5.4
  • Builder: vite
  • User Config: meta, ssr, buildModules, css, components, publicRuntimeConfig, experimental, vite, build
  • Runtime Modules: -
  • Build Modules: @vueuse/nuxt@7.7.1, @pinia/nuxt@0.1.8

Reproduction

all

Describe the bug

<head >
  <link rel="stylesheet" href="/_nuxt/entry.cabc84ae.css">
</head>

I run npm run generate .

But I get path /

I wish It is ./

Additional context

no

Logs

no
@mlsjla mlsjla changed the title nuxt3-rc generate and url is not relationUrl nuxt3-rc generate and url is not relative Url Apr 21, 2022
@danielroe
Copy link
Member

You can either run:

NUXT_APP_BASE_URL=./ npm run generate

Or set it in your nuxt config:

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  app: {
    baseURL: process.env.NODE_ENV === 'production' ? './' : '/'
  }
})

Does that solve your issue?

@mlsjla
Copy link
Author

mlsjla commented Apr 21, 2022

thanks I generate success....
But I find a error

entry-5c534801.mjs

chrome Can't referer because of "cross-origin"

Request URL: .output/public/_nuxt/entry-5c534801.mjs
Referrer policy: strict-origin-when-cross-origin
Provisional headers are shown
Learn more
Origin: null
Referer
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1

@danielroe
Copy link
Member

That sounds like an issue with your hosting rather than Nuxt. Would you provide a reproduction?

@mlsjla
Copy link
Author

mlsjla commented Apr 21, 2022

thank u for reply...

I update the repo..
https://github.com/mlsjla/testnuxt3

@mlsjla
Copy link
Author

mlsjla commented Apr 22, 2022

I just open the index.html file in finder...
so The host is file path...

@danielroe
Copy link
Member

Would you try with the latest version, currently 3.0.0-rc.2-27530596.a862a67? (A related issue was resolved in nuxt/framework#4844.)

@mlsjla
Copy link
Author

mlsjla commented May 7, 2022

I try again and find some files is done ,but three files is also cros error.

cros error:

.output/public/_nuxt/default-8aafa2a6.mjs
output/public/_nuxt/index-7262e5c7.mjs
.output/public/_nuxt/entry-584f7390.mjs

done and success files like ...

.output/public/_nuxt/user-4f682f60.mjs
.output/public/_nuxt/post-2843423b.mjs
....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants