question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nuxt3-rc generate and url is not relative Url

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, Apr 21, 2022

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?

0reactions
mlsjlacommented, 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
....
Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt.js static site relative urls - Stack Overflow
The web app has been generated. Deploying to netfify isn't an option for me. This is a local webapp, it is not meant...
Read more >
Creating Redirects With Nuxt - Josh Deltener
This template uses a library called url-parse which makes chopping relative urls easy (since Node's native URL lib doesn't support them). import Url...
Read more >
[Solved]-Nuxt.js static site relative urls-Vue.js
Coding example for the question Nuxt.js static site relative urls-Vue.js. ... Full static Nuxt do not require any server indeed.
Read more >
Why are dynamic Link not relative to the current path : r/nextjs
Hello. I have a page located in pages/courses/[slug]/index.js so its route is /course/1 , and I have Links components in that page that ......
Read more >
Assets directory - Nuxt
Inside your vue templates, if you need to link to your assets directory use ... In case you want to use sass make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found