Skip to content

File extension required in serverMiddleware #80

@llienard

Description

@llienard

Describe the bug
File extension .ts is required in nuxt.config.ts serverMiddleware

To Reproduce
Steps to reproduce the behavior:

  1. Create a nuxt typerscript project
  2. Create a file server/middleware.ts
  3. Set it to nuxt.config.ts like
{
serverMiddleware: [
    '~/server/middleware' // without extension
  ]
}
  1. Build with node ./node_modules/\@nuxt/typescript-runtime/bin/nuxt-ts.js build
  2. Start with node ./node_modules/\@nuxt/typescript-runtime/bin/nuxt-ts.js start
  3. See error

Error: Cannot find module '~/server/middleware'

Expected behavior
This should work

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingruntimeThe issue or pull request is related to `runtime` package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions