Mirage
Mirage
NNuxt
Created by Mirage on 12/27/2024 in #❓・help
Cannot read properties of undefined (reading 'isKeyObject')
@kapa.ai How to deploy nuxt on netlify on Node runtime instead of edge?
10 replies
NNuxt
Created by Mirage on 12/20/2024 in #❓・help
Dynamically load i18n messages based on context
@kapa.ai Does the page:start hook awaits the callback to finish before loading the page? E.g. to make sure the new translations are loaded before displaying the page to the user.
10 replies
NNuxt
Created by Mirage on 12/11/2024 in #❓・help
Environment variables not available when running on Netlify Edge
I solved this by supplying the value in nuxt.config.ts which hardcodes the environment variable during build. So instead of:
export default defineNuxtConfig({
runtimeConfig: {
// Private keys are only available server-side
apiSecret: '',
// Public keys that are exposed to the client
public: {
apiBase: ''
}
}
})
export default defineNuxtConfig({
runtimeConfig: {
// Private keys are only available server-side
apiSecret: '',
// Public keys that are exposed to the client
public: {
apiBase: ''
}
}
})
I used:
export default defineNuxtConfig({
runtimeConfig: {
// Private keys are only available server-side
apiSecret: process.env.NUXT_API_SECRET!,
// Public keys that are exposed to the client
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE!
}
}
})
export default defineNuxtConfig({
runtimeConfig: {
// Private keys are only available server-side
apiSecret: process.env.NUXT_API_SECRET!,
// Public keys that are exposed to the client
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE!
}
}
})
It kinda makes sense to me that this works, but not sure if there are any security implications with this usage. Especially for secrets / non-NUXT_PUBLIC_ variables.
8 replies
NNuxt
Created by Mirage on 12/11/2024 in #❓・help
Environment variables not available when running on Netlify Edge
Could be a Netlify issue, so I have to check that as well
8 replies
NNuxt
Created by Mirage on 12/11/2024 in #❓・help
Environment variables not available when running on Netlify Edge
As mentioned in my post I already made those suggested steps.
8 replies
NNuxt
Created by Mirage on 11/25/2024 in #❓・help
I get TypeError: Object prototype may only be an Object or null: undefined when deploying to Netlify
This unfortunately didn't help me, the suggested command is incorrect and source-map-cli can't resolve the mapping. However, I was able to track the issue down by gradually applying new changes to find the culprit. (jsonwebtoken was the problem and had to use jose instead)
6 replies
NNuxt
Created by Mirage on 11/13/2024 in #❓・help
[resolved] Why using await inside composables cause them to break?
I'm not sure if this will work, but I will try to use all await statements at the end in compination with ref() / computed() values.
7 replies
NNuxt
Created by Mirage on 11/13/2024 in #❓・help
[resolved] Why using await inside composables cause them to break?
Impressive! This pretty much answered everything I wanted to know regarding this issue. Great job to everyone working on this AI / Knowledge base, thank you!
7 replies
NNuxt
Created by Mirage on 10/18/2024 in #❓・help
[resolved] How would you implement showing a success message after posting a form?
I ended up using success=true just like you suggested. It's the most forward approach, even though it has the issue of being persistent so long as the parameter existing in the url. I'll revisit this topic in the future to see if I can come up with a better approach.
7 replies
NNuxt
Created by Mirage on 10/15/2024 in #❓・help
Nuxt-auth causing 500 Server Error due to invalid url passed to `new URL`.
Perfect!
6 replies
NNuxt
Created by Mirage on 10/15/2024 in #❓・help
Nuxt-auth causing 500 Server Error due to invalid url passed to `new URL`.
Thanks a lot for clarifying how this works. Is my understanding correct that npx nuxi upgrade -f will still upgrade non-root dependencies even if I'm already running latest Nuxt version? Because that was my case (I created the project around 2 weeks ago), because this isn't mentioned in the documentation. Regardless, I'd still give it a shot next time I encounter a similar issue.
6 replies
NNuxt
Created by Mirage on 10/15/2024 in #❓・help
Nuxt-auth causing 500 Server Error due to invalid url passed to `new URL`.
No description
6 replies
NNuxt
Created by Mirage on 10/3/2024 in #❓・help
Prisma Studio asks to be installed in Nuxt DevTools with each reload?
Sooo, this seems to do it:
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: [
'@sidebase/nuxt-auth',
'@prisma/nuxt',
'@nuxtjs/tailwindcss',
],
...
prisma: {
autoSetupPrisma: process.env.NODE_ENV === 'development' ? true : undefined, // <-- this
},
tailwindcss: {
exposeConfig: true,
},
})
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: [
'@sidebase/nuxt-auth',
'@prisma/nuxt',
'@nuxtjs/tailwindcss',
],
...
prisma: {
autoSetupPrisma: process.env.NODE_ENV === 'development' ? true : undefined, // <-- this
},
tailwindcss: {
exposeConfig: true,
},
})
Idk if it's necessary to make the NODE_ENV check, but I figured it's safer
3 replies
NNuxt
Created by Mirage on 10/3/2024 in #❓・help
Prisma Studio asks to be installed in Nuxt DevTools with each reload?
I also tried this, but doesn't seem to fix it
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: [
'@sidebase/nuxt-auth',
'@prisma/nuxt',
'@nuxtjs/tailwindcss',
],
...
prisma: {
installStudio: true, // <-- this
},
tailwindcss: {
exposeConfig: true,
},
})
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: [
'@sidebase/nuxt-auth',
'@prisma/nuxt',
'@nuxtjs/tailwindcss',
],
...
prisma: {
installStudio: true, // <-- this
},
tailwindcss: {
exposeConfig: true,
},
})
3 replies