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.

Can't resolve '@theme-ui/css/dist/types' in '...node_modules/@theme-ui/core/dist'

See original GitHub issue

As of yesterday “theme-ui”: “0.4.0-rc.1” alll was well, but as I come to continue development of my gatsby site I have this breakage and am still trying to follow the flow as to what has changed.

The referenced file exists but vscode complains that it ‘Contains emphasized items’ … but no errors show in the code in the file … except Cannot read file ‘…/node_modules/tsconfig.json’. in the vscode log.

Edit: Initially I had theme-ui 0.4.0-rc.1 and theme-ui component pinned at 0.3.1, but it seems that no longer works for some reason and the only way I get get a build, was to revert both back to 0.3.1

I thought I’d ask in case someone can help me locate the issue?

Thanks in advance.

failed Building production JavaScript and CSS bundles - 50.127s

 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '@theme-ui/css/dist/types' in '/home/local/site/node_modules/@theme-ui/core/dist'

If you're trying to use a package make sure that '@theme-ui/css/dist/types' is installed. If you're trying to use a local file make sure that the path is correct.

File: ../node_modules/@theme-ui/core/dist/index.esm.js

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
hasparuscommented, Aug 17, 2020

I broke it! I’m sorry 🙏🙇

0.4.0-rc.3 builds incorrectly.

import of @theme-ui/css/dist/types shouldn’t land in @theme-ui/core/dist/index.esm.js.

Adding "0.4.0-rc.1" to resolutions for "@theme-ui/core", "@theme-ui/css" and @theme-ui/mdx”` should be an okayish workaround.

3reactions
djfarlycommented, Aug 16, 2020

Same with v0.4.0-rc.3

Yes I should have added, I did a clean check with rc 1,2 and 3 and they all had the same error.

It was odd as i say as I’d been using parts of rc1 for a good while without any issues.

It has to happen with rc.1 and rc.2 as well because even if you explicitly request rc.1 (or 2) from your package.json theme-ui still uses ^0.4.0-rc.1 (with a caret) internally, which resolves to rc.3 currently. Thus both versions will be used (one from your code, one from theme-ui internal dependencies; check the nested node_modules folder).

If someone urgently needs a hotfix you should be able to add a resolution to the package.json like so:

  "resolutions": {
    "@theme-ui/core": "0.4.0-rc.1"
  }

Otherwise just wait… a release candidate is not stable software. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack suddenly fails to compile due to "Module not found ...
I had this issue and solved by fixing my modules resolution settings in Jest. With the current state of things, my package-lock includes:...
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