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

Fix broken browser file reference in primitives-core/package.json #3228

Merged
merged 2 commits into from
Jul 28, 2024

Conversation

daern91
Copy link
Contributor

@daern91 daern91 commented Jul 28, 2024

remove non-existing ref to file

What:

I'm running into below, missing file reference error, when using expo and react-native when targeting web.

Starting Metro Bundler
Web ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (2071/2071)Error: While trying to resolve module `@emotion/primitives-core` from file `/Users/me/super-duper-project/node_modules/@emotion/native/dist/emotion-native.esm.js`, the package `/Users/me/super-duper-project/node_modules/@emotion/primitives-core/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js`. Indeed, none of these files exist:

  * /Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
  * /Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js/index(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
Error: While trying to resolve module `@emotion/primitives-core` from file `/Users/me/super-duper-project/node_modules/@emotion/native/dist/emotion-native.esm.js`, the package `/Users/me/super-duper-project/node_modules/@emotion/primitives-core/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js`. Indeed, none of these files exist:

  * /Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
  * /Users/me/super-duper-project/node_modules/@emotion/primitives-core/dist/emotion-primitives-core.browser.esm.js/index(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
    at DependencyGraph.resolveDependency (/Users/me/super-duper-project/node_modules/metro/src/node-haste/DependencyGraph.js:243:17)
    at /Users/me/super-duper-project/node_modules/metro/src/lib/transformHelpers.js:156:21
    at resolveDependencies (/Users/me/super-duper-project/node_modules/metro/src/DeltaBundler/buildSubgraph.js:42:25)
    at visit (/Users/me/super-duper-project/node_modules/metro/src/DeltaBundler/buildSubgraph.js:83:30)
    at async Promise.all (index 11)
    at visit (/Users/me/super-duper-project/node_modules/metro/src/DeltaBundler/buildSubgraph.js:92:5)
    at async Promise.all (index 2)
    at visit (/Users/me/super-duper-project/node_modules/metro/src/DeltaBundler/buildSubgraph.js:92:5)
    at async Promise.all (index 0)
    at buildSubgraph (/Users/me/super-duper-project/node_modules/metro/src/DeltaBundler/buildSubgraph.js:103:3)

Why:

Since the target file doesn't exist, I tested without this ref altogether and everything works fine.

How:

Removing the ref in the package.json solves the problem.

Checklist:

  • Documentation
  • Tests
  • Code complete
  • Changeset

remove non-existing ref to file
Copy link

changeset-bot bot commented Jul 28, 2024

🦋 Changeset detected

Latest commit: 30bc686

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@emotion/primitives-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@daern91 daern91 changed the title Fix breaking file reference in primitives-core/package.json Fix broken browser file reference in primitives-core/package.json Jul 28, 2024
Copy link

codesandbox-ci bot commented Jul 28, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@emmatown emmatown merged commit 49f7435 into emotion-js:main Jul 28, 2024
13 checks passed
@github-actions github-actions bot mentioned this pull request Jul 28, 2024
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 this pull request may close these issues.

None yet

2 participants