Link import code broken since 9.5.0 (Type error: Cannot use namespace 'Link' as a type.)
See original GitHub issueBug 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.
Module code:
To Reproduce
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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as this is the intended behavior as explained by @lfades (and OP ack’d).
@ElvenSpellmaker No,
Link["props"]
isn’t valid,Link
is a value, not a type. MeanwhileLinkProps
is a type designed for this case.