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.

Version 9.0.2 typings error.

See original GitHub issue

Bug report

Describe the bug

In version 9.0.2 we get an error, connected with typings. It appears when we try to create a Next Server.

To Reproduce

In version 8, we could import like import * as next from 'next' and it worked correctly both on JavaScript and TypeScript sides. So we got no errors connected with typings and javascript compiler. But now, we have to import via import next from 'next'. There is no doubt it works correctly in TypeScript’s mind, but when we try to run an application, we get an error:

TypeError: next_1.default is not a function

In addition, I got an error, connected with props of component exported from _app. I just create a class ThemedApp extends App<SomeProps> and get an error while trying to get something from this.props.

Expected behavior

next import have to be saved in current state, but error doesn’t occur. So, it is good we can import a bit more natively via import next from 'next', but this error makes some problems.

Screenshots

image image

System information

  • OS: Ubuntu 18
  • Version of Next.js: 9.0.2

Additional context

No information.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
heyqbnkcommented, Jul 28, 2019

Okay, I got problem solved. I just followed custom-server-typescript and used tsconfig.json and tsconfig.server.json options. There are no problems now.

Leaving a migration from 8 to 9 version case: v8 state: https://github.com/wolframdeus/ssr-server-template/tree/815eee98210a7ee1313dad4e267976406a0390b2 v9 migration commit: https://github.com/wolframdeus/ssr-server-template/commit/c8b100d928c2e22e3731be0b5fc4e3bb2158caf3

1reaction
lfadescommented, Jul 26, 2019

@yceffort Please use a different tsconfig for the server, you can see how by following the custom-server-typescript example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version 9.0.2 typings error. · Issue #8029 · vercel/next.js - GitHub
Describe the bug. In version 9.0.2 we get an error, connected with typings. It appears when we try to create a Next Server....
Read more >
Mongoose is causing 100+ type errors that break the build?
The answer actually turned out to be a TypeScript problem. For whatever reason, earlier versions don't like the current typing in Mongo/ose, ...
Read more >
#1760 Version 9.0.2 error message - Issues - Ackis Recipe List ...
Version 9.0.2 error message ... Can click in field and start typing, but after a few seconds the window resets and the search...
Read more >
Handsontable not compiled with angular js 9 version - Issues
js module not found. I tried installing gpu.js but it failed with proxy error. What is the workaround ? I am using angular...
Read more >
Firebase JavaScript SDK Release Notes - Google
These typings caused errors in some projects using both Node.js and TypeScript. App Check. Fixed a bug where @firebase/app-check-types ...
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