Skip to content

Typescript custom server example is broken #4580

@AleksandarAleksandrov

Description

@AleksandarAleksandrov

Typescript custom server example is broken

Example name

custom-server-typescript

Describe the bug

When launching the demo with yarn run dev the following error is displayed:

D:\temp\custom-server-typescript> npm run dev
> @ dev D:\temp\custom-server-typescript
> nodemon server/index.ts

[nodemon] 1.17.5[nodemon] to restart at any time, enter `rs`
[nodemon] watching: server/**/*.ts
[nodemon] starting `ts-node --compilerOptions '{"module":"commonjs"}' server/index.ts`
undefined:1
'{module:commonjs}'
^

SyntaxError: Unexpected token ' in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.parse (D:\temp\custom-server-typescript\node_modules\ts-node\dist\index.js:53:25)
    at Object.<anonymous> (D:\temp\custom-server-typescript\node_modules\ts-node\dist\_bin.js:92:30)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:194:16)
[nodemon] app crashed - waiting for file changes before starting...

To Reproduce

Clone the example repository, install the dependencies and type yarn run dev

Expected behavior

The example shoud work.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [Windows 10]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: [latest]

Additional context

Add any other context about the problem here.

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