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

Initial scaffolded project with @astrojs/lit erroring: module is not defined #6444

Closed
1 task done
cbarratt opened this issue Mar 7, 2023 · 1 comment · Fixed by #6460
Closed
1 task done

Initial scaffolded project with @astrojs/lit erroring: module is not defined #6444

cbarratt opened this issue Mar 7, 2023 · 1 comment · Fixed by #6460
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work

Comments

@cbarratt
Copy link

cbarratt commented Mar 7, 2023

What version of astro are you using?

^2.0.18

Are you using an SSR adapter? If so, which one?

Netlify, but happens with no SSR

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

NOTE:

This appears to be ok when using yarn, but not pnpm

If I do pnpm install --force --shamefully-flatten, it works

I've just gone to setup a brand new astro project using the astro cli to scaffold it so, i then proceeded to add the lit integration using pnpm astro add lit.

Once the lit() integration was added, the site will error:

ReferenceError: module is not defined
    at eval (/Users/callumbarratt/projects/checkout-web/node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js:18:1)
    at instantiateModule (file:///Users/callumbarratt/projects/checkout-web/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:52420:15)

Link to Minimal Reproducible Example

https://github.com/dankochetov/astro-test-2

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Mar 7, 2023

lit requires this .npmrc to work with pnpm:

public-hoist-pattern[]=*lit*

Maybe astro add needs to be tweaked to add that if it doesn't exist, for pnpm.

@bluwy bluwy added - P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work labels Mar 7, 2023
@bluwy bluwy self-assigned this Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants