mpgalaxy
mpgalaxy
Explore posts from servers
NNuxt
Created by mpgalaxy on 3/4/2025 in #❓・help
Use crypto server side in nuxt3 (3.8) with node 18
Hi, how can I use crypto server side in nuxt3 (3.8) with node 18 ? There is a recommendation for a server side plugin, but this isn't working:
# plugins/crypto.server.ts
export default defineNuxtPlugin(() => {
if (process.server) {
const crypto = require('crypto');
global.crypto = crypto;
}
})
# plugins/crypto.server.ts
export default defineNuxtPlugin(() => {
if (process.server) {
const crypto = require('crypto');
global.crypto = crypto;
}
})
Using this I get a 500 error Cannot assign to read only property 'crypto' of object '#<Object>' The recommendation came from https://github.com/nuxt/nuxt/discussions/19290
8 replies
PPrisma
Created by mpgalaxy on 5/16/2024 in #help-and-questions
Filter (where) for nonexistant boolean field
Hi, is there a way in prisma to filter in where for a nonexisting boolean field ? Curent situation: prisma 4.10 + graphql + nexus with mongoDB We introduced a Boolean field later on and the older datasets don't have this field. In my queries I want to filter for this field to be false or nonexistant, but undefined is treated differently in prisma and isSet or null are not allowed for boolean fields. How can I filter for these conditions ?
2 replies
NNuxt
Created by mpgalaxy on 6/20/2023 in #❓・help
vue3-form-generatror not rendering
Hi guys, I'm trying to get vue3-form-generator ( https://gitlab.com/nick7dam/vue3-form-generator/-/tree/master ) to work with nuxt3 and I wanted to ask if some of you can help me out. I wrapped this as a plugin
import VueFormGenerator from "vue3-form-generator";

export default defineNuxtPlugin((nuxtApp) => {
return {
provide: {
VueFormGenerator,
},
};
});
import VueFormGenerator from "vue3-form-generator";

export default defineNuxtPlugin((nuxtApp) => {
return {
provide: {
VueFormGenerator,
},
};
});
and on my page (options api, not composition api) I included it like this:
import VueFormGenerator from "vue3-form-generator";
import "vue3-form-generator/dist/style.css";
...
components: {
VueFormGenerator,
},
...
import VueFormGenerator from "vue3-form-generator";
import "vue3-form-generator/dist/style.css";
...
components: {
VueFormGenerator,
},
...
with the default model, schema and formOptions provided by the readme but it doesn't get rendered, I always receive a
Component is missing template or render function.
at <AbstractField schema= {fields: Array(6)} model= {id: 1, name: 'John Doe', password: 'J0hnD03!x4', skills: Array(2), email: '[email protected]', …} tag="div" >
...
Component is missing template or render function.
at <AbstractField schema= {fields: Array(6)} model= {id: 1, name: 'John Doe', password: 'J0hnD03!x4', skills: Array(2), email: '[email protected]', …} tag="div" >
...
1 replies
NNuxt
Created by mpgalaxy on 6/6/2023 in #❓・help
use dotenv in options api
Hi, how can I use env variables in options api ? I predefined env variables in nuxt.config via
runtimeConfig: {
public: {
KEYCLOAK_SCHEME: process.env.KEYCLOAK_SCHEME || 'http',
KEYCLOAK_HOST: process.env.KEYCLOAK_HOST || 'localhost',
KEYCLOAK_PORT: process.env.KEYCLOAK_PORT ||'8080',
KEYCLOAK_CLIENT_ID: process.env.KEYCLOAK_CLIENT_ID || 'testclient',
KEYCLOAK_REALM: process.env.KEYCLOAK_REALM || 'testrealm'
},
}
runtimeConfig: {
public: {
KEYCLOAK_SCHEME: process.env.KEYCLOAK_SCHEME || 'http',
KEYCLOAK_HOST: process.env.KEYCLOAK_HOST || 'localhost',
KEYCLOAK_PORT: process.env.KEYCLOAK_PORT ||'8080',
KEYCLOAK_CLIENT_ID: process.env.KEYCLOAK_CLIENT_ID || 'testclient',
KEYCLOAK_REALM: process.env.KEYCLOAK_REALM || 'testrealm'
},
}
but I can't access .env variables globally by using process.env.KEYCLOAK_HOST nor can I access the runtimeConfig from options api, how can I do that ?
2 replies
NNuxt
Created by mpgalaxy on 6/5/2023 in #❓・help
i18n in modal (nuxt3)
Hi, can anyone tell me how I can add i18n support to modals in nuxt3 ? I can use i18n at the base site, but I need a scoped i18n in my modal which was working perfectly fine with the i18n module for nuxt2. How can I do this in nuxt3 ? I use the options api wrapped by defineNuxtComponent(...)
7 replies
NNuxt
Created by mpgalaxy on 5/31/2023 in #❓・help
Nuxt3 with @sidebase/nuxt-auth and Keycloak
Hi, I'm trying to use the nuxt-auth module from sidebase (^0.6.0-beta.2) with oauth and according to the docs this type should be supported using a custom provider ( https://sidebase.io/nuxt-auth/v0.6/getting-started/quick-start -> authentication provider link -> https://next-auth.js.org/configuration/providers/oauth#using-a-custom-provider ), but the module complains that type oauth is unknown ( Failed to resolve import node_modules/@sidebase/nuxt-auth/dist/runtime/composables/oauth/useAuthState from node_modules/@sidebase/nuxt-auth/dist/runtime/utils/url.mjs?v=822da449 ). Can anyone provide an example of a configuration with external keycloak using redirect to keycloak login page (OpenIDConnect) with this auth module ?
3 replies