Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mannp opened this issue Aug 15, 2020 · 12 comments · Fixed by #1137
Closed

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

mannp opened this issue Aug 15, 2020 · 12 comments · Fixed by #1137

Comments

@mannp
Copy link

mannp commented Aug 15, 2020

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
@matthewsimo
Copy link

I ran into this too this morning, reverting to 0.3.1 oddly broke the [padding/margin]-[inline/block]-[start/end] referencing the space scale (outputting 3px instead of space[3]) and jacked up rendering badly so that's a no go for me unfortunately. I don't have time to trace it at the moment but if I get some time tomorrow I'll try to give a closer look.

@lachlanjc
Copy link
Member

Had the same issue in development. This is a must-fix for v0.4

@luizcieslak
Copy link

Same with v0.4.0-rc.3

@mannp
Copy link
Author

mannp commented 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.

@djfarly
Copy link

djfarly commented 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. ;)

@mannp
Copy link
Author

mannp commented 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

Otherwise just wait... a release candidate is not stable software. ;)

Fair enough, works for me on 0.3.1 so sticking with that for now...just trying to add some further info ... is any software regardless of a ref stable? No one suggested anything other, happy to wait, as long as it takes.

@hasparus
Copy link
Member

hasparus commented 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.

@mannp
Copy link
Author

mannp commented Aug 17, 2020

Cool :)

Tried resolutions here and it didn't change anything for me, but good it works for others 👍

@atanasster
Copy link
Collaborator

just to confirm resolutions workaround works here.

@nandorojo
Copy link

nandorojo commented Jan 21, 2021

@hasparus What is the latest solution to this? Is there a particular version of theme-ui I should upgrade dripsy to?

Dripsy currently uses these versions:

{
  "@theme-ui/core": "^0.4.0-rc.1",
  "@theme-ui/css": "^0.4.0-rc.1"
}

And users have this in their package.json:

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

Ideally, I could change this to not need yarn resolutions, since it seems to slow yarn install down quite a bit.

@hasparus
Copy link
Member

@nandorojo all versions after 0.4.0-rc.3 should be fine. Do you still have this problem with them?

@nandorojo
Copy link

I'll upgrade then - just wanted to check before pushing the change to everyone. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants