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.

pkg.exports broken in typescript

See original GitHub issue

This compiled to typescript doesn’t work:

import { v4 } from 'uuid';
v4();

Error: Error: Package exports for '........ /node_modules/uuid' do not define a valid '.' target

I had to downgrade to v7

_Originally posted by @kryz81 in https://github.com/uuidjs/uuid/issues/245#issuecomment-640027851_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
ctavancommented, Jun 9, 2020

This library only officially supports LTS releases of Node.js (v8, v12, v14).

At this point I would not suggest to stick to Node.js v13.x because it already reached end-of-life. Instead upgrade to v14. Please check https://nodejs.org/en/about/releases/ for details on Node.js versioning semantics.

1reaction
TrySoundcommented, Jun 9, 2020

I guess it’s the same problem with very old node 13. Check node v13.14 please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New package.json `exports` field not working with TypeScript
The version 13.2 of Node. js allows ESM modules and a new package. json field, called exports , to select and rewrite exported...
Read more >
Documentation - Modules - TypeScript
The export = syntax specifies a single object that is exported from the module. This can be a class, interface, namespace, function, or...
Read more >
API - esbuild
This changes how the exports field in package.json files is interpreted to prefer node-specific code. If no custom conditions are configured, the Webpack- ......
Read more >
Support "exports" field of package.json : WEB-40509 - YouTrack
Open index.js . · Try navigating to definition of HelloDependency from the statement where the instance is constructed. · Delete the import statement...
Read more >
TypeScript Exports error breaks Telerik Blazor - Documentation
The cause for the first error is that TypeScript, by default, produces JavaScript code that is designed for use through various package managers...
Read more >

github_iconTop Related Medium Post

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