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.

Link import code broken since 9.5.0 (Type error: Cannot use namespace 'Link' as a type.)

See original GitHub issue

Bug report

Describe the bug

Since 9.5.0 our app won’t compile as the module code contains the Link type followed straight by a Namespace and exports the Namespace instead of the type. image

Module code: image

To Reproduce

https://github.com/amido/stacks-webapp-template/blob/master/packages/scaffolding-cli/templates/src/ssr/components/Link/index.tsx

Using code like the above compile the application with node_modules/.bin/tsc --project tsconfig.server.json and then node_modules/.bin/next build.

Expected behavior

Compiles correctly.

System information

  • OS: Windows, Cygwin or Ubuntu
  • Browser N/A
  • Version of Next.js: >9.5.0
  • Version of Node.js: v12.13.0 or 12.18.3

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Timercommented, Aug 24, 2020

Closing as this is the intended behavior as explained by @lfades (and OP ack’d).

1reaction
lfadescommented, Aug 23, 2020

@ElvenSpellmaker No, Link["props"] isn’t valid, Link is a value, not a type. Meanwhile LinkProps is a type designed for this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing the "Cannot Use Namespace as a Type" Error in ...
Are you experiencing the “cannot use namespace as a type” error in TypeScript? This error can occur when you try to import types...
Read more >
How to fix 'Cannot use namespace as a type ts(2709)' in ...
It looks like you are expecting to use the default export. Perhaps for you this might work? declare type SortedArray = typeof import("sorted-array") ......
Read more >
Fix list for Rational Software Architect Designer
This document contains a complete listing of releases, refreshes, fix packs and interim fixes sorted by version for IBM Rational Software Architect.
Read more >
Firebase Admin Node.js SDK Release Notes - Google
Developers should use Node.js 14 or higher when deploying the Admin SDK. Breaking change: ... Exposed several new types from the admin.firestore namespace....
Read more >
Migration Guide
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
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