Help with exporting composable from Custom Module [Still need help]
Hey so I am working on a Nuxt 3 Module that adds support for Neo4J.
I have come pretty far and the Module is on npm and also on github https://github.com/DerSimeon/NeoNuxt
Unfortunately when I try to use it, I get this error:
Package subpath './dist/runtime/server/composables/NeoDriver' is not defined by "exports" in G:\Project X\Web\apply\node_modules\neonuxt\package.json imported from G:\Project X\Web\apply\.nuxt\dev\index.mjs
Does anyone know how to fix it?26 Replies
I am exporting it here:
https://github.com/DerSimeon/NeoNuxt/blob/main/src/runtime/server/composables/NeoDriver.ts
GitHub
NeoNuxt/src/runtime/server/composables/NeoDriver.ts at main · DerSi...
A Simple Neo4J Module for Nuxt. Contribute to DerSimeon/NeoNuxt development by creating an account on GitHub.
bump
@Just Simeon composables does not exist in server folder. You can put it in server/utils/{composable}
Do I have to change something else besides the location?
i think it'is okay
now its not being exported at all
you need to relaunch your server
Nuxt
server/ · Nuxt Directory Structure
The server/ directory is used to register API and server handlers to your application.
okay now it let me import it, but its still complaining:
you dont need to import it
nuxt do it for you
is there a way to get rid of the error tho?
because it would be super annoying if the error is there the whole time
refresh your ide
still happening
you cvan import it
but you have an error in yout ide ??
as you can see in the screenshots:
If I don't import it, it says Cannot find name
withNeoDriver
and if I do import it, it says Vue: Cannot find module neonuxt/dist/runtime/server/utils/NeoDriver or its corresponding type declarations.
did you have the next file in your server folder : https://nuxt.com/docs/guide/directory-structure/server#server-types
Nuxt
server/ · Nuxt Directory Structure
The server/ directory is used to register API and server handlers to your application.
what is the "next file"?
server/tsconfig.json
check link
Yes I have a tsconfig.json in src/runtime/server
what now?
do you restart your ide ?
yes twice
weird
Maybe someone else has an Idea?
bump