NuxtN
Nuxt2y ago
JT

Having a problem with imports: Dev works, Prod does not

First, in case it matters, my source code is all here: https://github.com/plainblack/ving

I have this in package.json

"imports": {
    "#ving/*": "./ving/*"
  },


This ving folder is in my nuxt root, but it is not inside of /app or /server.

My app has a Vue interface (inside the /app folder), a REST interface, inside the /server folder, and a CLI interface inside the /ving folder. The libraries for the whole app are in the /ving folder and the REST inteface accesses those just fine in dev mode.

However, now when I run npm run build and then npm run preview I get this error:

[nuxt] [request error] [unhandled] [500] Package import specifier "#ving/drizzle/schema/User.mjs" is not defined in package /Users/jtsmith/ving/.output/server/package.json imported from /Users/jtsmith/ving/.output/server/chunks/runtime.mjs


How do I build the production mode so that it imports these files correctly like dev mode does?
GitHub
An opinionated web services starter for Nuxt3 that provides REST and per-field privileges out of the box. - plainblack/ving
GitHub - plainblack/ving: An opinionated web services starter for N...
Was this page helpful?