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.

Missing exports warning from `yarn build`

See original GitHub issue

The following warning is produced from yarn build:

$ yarn build
yarn run v1.22.4
$ rollup --config

src/index.ts → dist/metamask-onboarding.cjs.js, dist/metamask-onboarding.es.js...
created dist/metamask-onboarding.cjs.js, dist/metamask-onboarding.es.js in 1s

src/index.ts → dist/metamask-onboarding.bundle.js...
(!) Missing exports
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/index.ts
parse is not exported by node_modules/bowser/src/bowser.js
175: 
176:   static _detectBrowser () {
177:     const browserInfo = Bowser.parse(window.navigator.userAgent);
                                    ^
178:     if (browserInfo.browser.name === 'Firefox') {
179:       return 'FIREFOX';
created dist/metamask-onboarding.bundle.js in 708ms

And we do have a namedExports option defined for cjs:

https://github.com/MetaMask/metamask-onboarding/blob/c476b69af5da0420c8b614e7e586f33c50003e40/rollup.config.js#L32-L36

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
trappedcommented, Mar 22, 2021

@nickfla1 just opened a PR with your changes.

2reactions
nickfla1commented, Mar 20, 2021

We solved changing the import line in index.ts from:

import * as Bowser from 'bowser';

to:

import Bowser from 'bowser';

and settings allowSyntheticDefaultImports to true inside tsconfig.json (compilerOptions).

Hope someone will find this useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-unused-export | Yarn - Package Manager
A CLI tool to check whether exported things in a module is used by other modules for Typescript.
Read more >
Why doesn't the exports field of npm work in typescript?
Take a look at Yarn workspaces or Bolt. Both of these will symlink your internal dependencies, so when you import them, as far...
Read more >
Troubleshooting | React Navigation
I'm getting "Module '[...]' has no exported member 'xxx' when using TypeScript​. This might happen if you have an old version of TypeScript...
Read more >
ts-node - npm
NPM version NPM downloads Build status Test coverage ... Missing Types; npx, yarn dlx, and node_modules. Performance.
Read more >
vite exports is not defined | The AI Search Engine You Control
shell view build $ yarn build --debug yarn run v1.22.17 warning ../package.json: No license field $ vite build --debug vite:config bundled config file ......
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