Questions tagged [nuxt.config.js]
25 questions
4
votes
0 answers
How to access config in nuxt.config.js in typescript file?
I am struggling with my nuxt project.
I try to access to config variables written in nuxt.config.js
I set my env variables in privateRuntimeConfig instead of dotenv. What I eventually want to do is that I want to access to
them in my typescript file…

Nam
- 41
- 3
4
votes
1 answer
NuxtJs Auth with multiple strategies, endpoints getting overwritten
I am building a web app using NuxtJs and I am using nuxtjs/auth-next for OAuth authorization with Google and Facebook auth providers. I have configured post authorization endpoints to fetch token from backend, while it works when I just have one…

Aster
- 203
- 1
- 4
- 16
3
votes
1 answer
How to set baseURL in Nuxt 3 in nuxt.config.ts instead of env
The documentation says:
By default, the baseURL is set to '/'.
However, the baseURL can be updated at runtime by setting the NUXT_APP_BASE_URL as an > environment variable.
Then, you can access this new base URL using…

Marian Klühspies
- 15,824
- 16
- 93
- 136
3
votes
0 answers
How to source javascript from node_module for Static Site Generation, in nuxt.config.js?
I am porting an older website into Nuxt. I am relatively new to Nuxt, and am trying to determine how to use nuxt.config.js file properly, for static site generation.
I am attempting to source .js files from npm packages. It is unclear to me from…

Kobi
- 4,003
- 4
- 18
- 23
2
votes
1 answer
Nuxt Js PWA - Metadata and theme_color not working in nuxt.config.js
I'm working in Nuxt, and just about to finish a website for live use with PWA support. However, the theme color isn't changing on app load up, as well as in other applications like Discord.
Likewise, the metadata inside of the config doesn't work.…

Austin Caron
- 78
- 5
2
votes
1 answer
Add all CSS files in a folder to nuxt.config
In my Nuxt project I have a folder assets/scss/globals/ with a lot of files which should be globally included.
Now in my nuxt.config file I can only include each file by manually like so:
// Global CSS: https://go.nuxtjs.dev/config-css
css:…

Dollique
- 952
- 2
- 10
- 29
1
vote
1 answer
In Nuxt Auth plugin, how to pass localstorage prefix parameter ? Prefix must be window.location.hostname
In nuxt.config.js
auth: {
localStorage: {
prefix: '[' + window.location.hostname + ']'
},
In output:
FATAL window is not defined 10:33:30
at…

VIktor
- 11
- 2
1
vote
1 answer
Using a custom HTTPS cert in Nuxt (but only for dev mode)?
I am using a dependency that requires me to have HTTPS on localhost. I've used the following code in nuxt.config.js to accomplish that:
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname,…

hipsterstomper69
- 317
- 1
- 6
- 19
0
votes
0 answers
How can make addresses defined in proxy of nuxt.config available in static generated files?
My nuxt.config of nuxt.js 2 of my project is defined as follows:
export default {
ssr:true,
target:'server',
router:{
base:'/',
middleware:['auth']
},
...
generate:{
dir:'docker/dist',
fallback:true
},
proxy:{
…

amir tbi
- 320
- 2
- 14
0
votes
0 answers
What can I do? How do i clear the front nuxt 3?
What can I do. how do i clear the front . I use Nuxt 3. Server is down. Pinia 3 off. There is no such data in the database. Nuxt 3 constantly gives me a page with old data from the database, what should I do?
on the server side i did through the…

Justin Moreyl
- 109
- 1
- 9
0
votes
0 answers
Cannot use import statement outside a module NuxtJs when activate Server-side rendering
I have encountered an issue while trying to enable server-side rendering (SSR) in my Nuxt 2 application. When I set ssr: true in the nuxt.config.js file, I receive the error message "Cannot use import statement outside a module."
To address this…

N.M
- 11
- 4
0
votes
1 answer
Nuxt 3 - Aliases - How can aliases be used inside a config file?
When trying to importing files through aliases at the configuration (nuxt.config.ts), an error occurs: Cannot find module '~/....
There is an example: codesnadbox.io
Short example
nuxt.config.ts
import { book } from "~/vars";
export default…

ALIZON
- 1
0
votes
0 answers
extendRoutes not accepting the dynamic urls
I have a url in nuxt app
https://example.netlify.app/nl/appartementen/strand?experiences_in[]=strand&types_in[]=appartementen
In which appartementen is a type & strand is an experience.
I write the extended routes code like that
routes.push({
…

Abdullah Zafar
- 171
- 8
0
votes
0 answers
Nuxt less loader to process all .less files with "scoped" attribute
we're working on a large VueJS project using Nuxt, and as we have an increasingly larger component and .less-file base, I started wondering if there's a way to force Nuxt to process all .less files as "scoped", like outlined in this comment about…

user2322742
- 1
- 1
0
votes
0 answers
How to make dynamic router base in config nuxt.config.js and set backend url target
Help me please, I need get data company based first path name company example http://localhost:3000/company_name/,
also the company name must be dynamic.
I was currently thinking of performing the data query in the configuration of nuxt.config.js
Or…

Angel
- 53
- 6