Skip to content

Files outside of app directory will not be transpiled #5666

@Swatinem

Description

@Swatinem

Bug report

Describe the bug

I have a monorepo usecase, where I want to share code between the next app and other modules that are located outside of the app folder.

It will end up with this error:

{ Error: (client) ../foo.ts 1:0
Module parse failed: The keyword 'interface' is reserved (1:0)
You may need an appropriate loader to handle this file type.
> interface Foo {
|   prop: string;
| }
 @ ./pages/index.tsx 4:0-28 8:5-8
 @ multi ./pages/index.tsx

To Reproduce

I have set up a simple repo here, based on the next-typescript example:

https://github.com/Swatinem/next-monorepo/tree/master

Expected behavior

Whatever I import should be transpiled like everything else, period.

System information

  • OS: linux
  • Version of Next.js: next@7.0.2

Additional context

Related issue (possibly a duplicate?): vercel/next-plugins#234
Also related maybe:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions