question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

with-typescript example not transpiling any ts files, giving 404

See original GitHub issue

Examples bug report

Example name

with-typescript

Describe the bug

Getting 404 when I visit http://localhost:3000.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. npx create-next-app --example with-typescript with-typescript-app
  2. cd with-typescript-app
  3. npm install
  4. npm run dev or npm run build && npm start
  5. Visit localhost:3000

Expected behavior

Expected to not get a 404 error.

Screenshots

image

image

System information

  • OS: MacOS Mojave
  • Browser: Google Chrome
  • Version of Next.js: 8.1

Additional context

It seems to me like the problem is that the index.js file is not being generated. Are the .babelrc and next.config.js files missing from the with-typescript example?

next.config.js

const withTypescript = require('@zeit/next-typescript')
module.exports = withTypescript()

.babelrc

{
  "presets": [
    "next/babel",
    "@zeit/next-typescript/babel"
  ]
}

When I manually add these two files (following this README: https://github.com/zeit/next-plugins/tree/master/packages/next-typescript) it works just fine:

image

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
arvindevacommented, Jun 26, 2019

I had this issue and running next@^8.1.1-canary.57 solved the issue.

1reaction
huv1kcommented, Jun 27, 2019

Hey @jplew, I updated example so it reflects the latest canary. Thx for heads up 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

with-typescript example not transpiling any ts files, giving 404
It seems to me like the problem is that the index.js file is not being generated. Are the .babelrc and next.config.js files missing...
Read more >
404 (Not Found) error using .ts files - Stack Overflow
ts file to main.js extention, there's no 404 error. Here is my systemjs.config.js file: (function (global) ...
Read more >
ts-node - npm
This error is thrown by node when a module has an unrecognized file extension, or no extension at all, and is being executed...
Read more >
Fight TypeScript with TypeScript - Tomasz Pluskiewicz
Here's my first test. I will place all tests in tests folder and my modules in the src folder as you can see...
Read more >
JSDoc typings: all the benefits of TypeScript, with none of the ...
Can I get the buildless, no transpiling simplicity of JavaScript, along with the ability to statically type functions and classes?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found