Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Warning "export 'xxx' was not found in '...'" #94

Closed
kristw opened this issue Feb 7, 2019 · 2 comments · Fixed by #99
Closed

Warning "export 'xxx' was not found in '...'" #94

kristw opened this issue Feb 7, 2019 · 2 comments · Fixed by #99
Labels
#bug Something isn't working #build Development environment

Comments

@kristw
Copy link
Contributor

kristw commented Feb 7, 2019

Describe the bug

Warning message about missing types. The types code are strip when transpile to javascript, but the exports are not.

WARNING in ./node_modules/@superset-ui/core/esm/index.js 1:178-260
"export 'RegistryConfig' was not found in './models/Registry'
 @ ./node_modules/@superset-ui/color/esm/CategoricalColorScale.js
 @ ./node_modules/@superset-ui/color/esm/CategoricalColorNamespace.js
 @ ./node_modules/@superset-ui/color/esm/index.js
 @ ./src/setup/setupColors.js
 @ ./src/preamble.js
 @ multi (webpack)-dev-server/client?http://localhost:9000 (webpack)/hot/dev-server.js babel-polyfill ./src/preamble.js

WARNING in ./node_modules/@superset-ui/core/esm/index.js 1:260-368
"export 'RegistryWithDefaultKeyConfig' was not found in './models/RegistryWithDefaultKey'
 @ ./node_modules/@superset-ui/color/esm/CategoricalColorScale.js
 @ ./node_modules/@superset-ui/color/esm/CategoricalColorNamespace.js
 @ ./node_modules/@superset-ui/color/esm/index.js
 @ ./src/setup/setupColors.js
 @ ./src/preamble.js
 @ multi (webpack)-dev-server/client?http://localhost:9000 (webpack)/hot/dev-server.js babel-polyfill ./src/preamble.js

WARNING in ./node_modules/@superset-ui/color/esm/index.js 1:459-542
"export 'SequentialSchemeConfig' was not found in './SequentialScheme'
 @ ./src/setup/setupColors.js
 @ ./src/preamble.js
 @ multi (webpack)-dev-server/client?http://localhost:9000 (webpack)/hot/dev-server.js babel-polyfill ./src/preamble.js

WARNING in ./node_modules/@superset-ui/connection/esm/index.js 1:42-122
"export 'SupersetClientInterface' was not found in './SupersetClient'
 @ ./src/setup/setupClient.js
 @ ./src/preamble.js
 @ multi (webpack)-dev-server/client?http://localhost:9000 (webpack)/hot/dev-server.js babel-polyfill ./src/preamble.js

See more details of similar issues.
webpack/webpack#7378

To Reproduce
Use the @superset-ui packages (that was written in TypeScript) in another app.

Expected behavior
Build successfully without warning.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • superset-ui version: 0.9.3
  • Node version: 10.10
  • npm version: 6.4.1
@kristw kristw added #bug Something isn't working #build Development environment labels Feb 7, 2019
@kristw
Copy link
Contributor Author

kristw commented Feb 7, 2019

One possible solution is to suppress error via webpack plugin on Superset side, but have to define list of what to suppress. Still not ideal.
https://github.com/igorkamyshev/ignore-not-found-export-plugin

@kristw
Copy link
Contributor Author

kristw commented Feb 14, 2019

Talked to Miles Johnson and got some advice.

You have a few options
1 - Don't re-export types.
2 - Move all types to a single file and use export * from './types';
3 - Create a special index file for esm that only exports values.
Like so: https://github.com/milesj/interweave/blob/master/packages/core/module.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
#bug Something isn't working #build Development environment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant