Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

How to add custom router? #10

Closed
imagine10255 opened this issue Mar 16, 2018 · 1 comment
Closed

How to add custom router? #10

imagine10255 opened this issue Mar 16, 2018 · 1 comment

Comments

@imagine10255
Copy link

Hi, I use typescript in nextjs 5
but use custom router show typescript error is:

Error:(9, 22) TS2306:File '/Users/apple/Documents/project/with-typescript-app/src/routes.ts' is not a module.

can you help me ? thx o_o

@deptno
Copy link
Owner

deptno commented Mar 16, 2018

not enough information but,

In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module. Conversely, a file without any top-level import or export declarations is treated as a script whose contents are available in the global scope (and therefore to modules as well).

typescript module article may help you.

this is not a issue related next.js-typescript-starter-kit.
if you need more advice. feel free to email me

@deptno deptno closed this as completed Mar 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants