Closed AsbDaryaee closed 5 months ago
Hi and thank you! Can you try to update to latest version 1.0.1?
Hi and thank you! Can you try to update to latest version 1.0.1?
Sorry, I made a mistake about the version I'm using. It's v1.0.1 and the results are like above.
Do you think it's possible for you to share your project with me? (doesn't need to be the whole project)
Do you think it's possible for you to share your project with me? (doesn't need to be the whole project)
Of course, This is my repository
Do you think it's possible for you to share your project with me? (doesn't need to be the whole project)
Of course, This is my repository
thank you! I will investigate and try to find the problem. thanks again
thank you! I will investigate and try to find the problem. thanks again
Thanks to you dear Arash.
well that's weird, lol. I build it and it's working, can you give me some more information ? npx nuxi info
the local build gives you error too or only when you deploy it? because I think you mentioned when I deploy the project, something goes wrong
, which service provider are you deploying to? sorry for all these questions 😄 thanks
Yes It works fine when I'm in development, even in my local computer works fine when I build the project same as yours. In deployment error occurs.
This is from my server:
Nuxt project info:
------------------------------
- Operating System: Linux
- Node Version: v18.17.1
- Nuxt Version: 3.7.3
- CLI Version: 3.9.0
- Nitro Version: 2.6.3
- Package Manager: pnpm@8.7.6
- Builder: -
- User Config: modules, css, postcss, app, mongoose, vite
- Runtime Modules: nuxt-mongoose@1.0.1
- Build Modules: -
------------------------------
which service provider are you deploying to?
My project is going to launch on Liara
Many Thanks :)
I see, I'll try to find the problem.
hey @AsbDaryaee, can you DM me on twitter?
@arashsheyda Hello! I'm having a very similar issue. I'm using version 1.0.2 and have followed the instructions in the docs
[6:04:47 PM] ERROR [worker reload] [worker init] Package import specifier "#nuxt/mongoose" is not defined in package /workspaces/CZQM-Site/package.json imported from /workspaces/CZQM-Site/models/User.js
// ~/models/User.js
import { defineMongooseModel } from '#nuxt/mongoose';
export const User = defineMongooseModel('User', {
cid: {
type: String,
required: true,
},
personal: {
type: Object,
required: true,
},
vatsim: {
type: Object,
required: true,
},
flags: [String],
bio: String,
});
// ~/nuxt.config.ts
export default defineNuxtConfig({
runtimeConfig: {
devtools: { enabled: true },
modules: ['@sidebase/nuxt-auth', 'nuxt-mongoose'],
mongoose: {
uri: 'my-uri=here',
options: {},
modelsDir: 'models',
},
});
// npx nuxi info
------------------------------
- Operating System: Linux
- Node Version: v20.8.0
- Nuxt Version: 3.7.4
- CLI Version: 3.9.0
- Nitro Version: 2.6.3
- Package Manager: npm@10.1.0
- Builder: -
- User Config: runtimeConfig, devtools, modules, auth, mongoose
- Runtime Modules: @sidebase/nuxt-auth@0.6.0-beta.7, nuxt-mongoose@1.0.2
- Build Modules: -
------------------------------
A new version of Nuxt Mongoose (v1.0.2) is available: https://github.com/arashsheyda/nuxt-mongoose/releases/latest
I appreciate your patience and understand the frustration you're facing @AsbDaryaee, @jackkoskie. I've thoroughly tested the package on Vercel and a custom VDS, and it seems to be functioning as expected in both environments. Since the issue persists on your server only (it work on localhost), it's likely a server-specific configuration that's causing the error.
To assist you better, could you please provide more details about your server's configuration? I hope this helps!
To assist you better, could you please provide more details about your server's configuration? I hope this helps!
Hey @arashsheyda! You mention it working on localhost however that is my issue, I am running it in dev mode on local host (github codespace). My environment is a 100% standard version of Ubuntu (latest lts version) with the latest stable version of node and npm as well as the latest stable versions of all standard packages. I will try it again in a completely empty repo however if two people are having the same issue then I'm going to guess the fix needs to be made within the package and not config side
I will try it again in a completely empty repo however if two people are having the same issue then I'm going to guess the fix needs to be made within the package and not config side
Yes you are right, thank you for that.
@arashsheyda It apears that the new update that was released (1.0.2) resolved this issue for me, in both the blank codebase and my actual codebase it works just fine in .2 but does not work in .1
Weird
I think you can consider this issue resolved
@jackkoskie Yes, v1.0.1 encountered build errors, and the files were not fully uploaded to npm during the release.
I encountered this error after changing tsconfig.json
& nuxt.config.ts
I wanted to setup Mongoose Zod.
Remove this from tsconfig.json
"compilerOptions": {
"strict": true
}
Remove this from nuxt.config.ts
typescript: {
typeCheck: true,
},
Hi, I really appreciate your endeavors. I updated the the package to version 1.0.0 and in build time I get these errors:
Everything is fine in development but when I deploy the project, something goes wrong.
This is my schema (~/server/models/message.model.ts):