Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
autoimports in server folder is not working if using js files - Nuxt
N
Nuxt
•
2y ago
thomasfjordside
autoimports in server folder is not working if using js files
The auto import of defineEventHandler
(and the rest
) is not working in
.js files within a server folder inside a layer
.
The autoimport is working fine if the file is in the top level app instead of the layer or if the file is a
.ts file
.
I have been able to replicate this with a new layer using the starter template
:
npx nuxi init --template layer
npx nuxi init --template layer
Is this expected behavior and the server folder only supports
.ts in layers or is it a possible bug
?
Nuxt
Join
Nuxt Community Chat Server
31,817
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
autoimports not updating
N
Nuxt / ❓・help
2y ago
Using useFetch in the /server folder
N
Nuxt / ❓・help
3y ago
/server folder
N
Nuxt / ❓・help
12mo ago
Import Error in Server Folder
N
Nuxt / ❓・help
7mo ago