Skip to content

Issue with astro add and @astrojs/mdx #5459

@Lofty-Brambles

Description

@Lofty-Brambles

What version of astro are you using?

1.6.10

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

None

What package manager are you using?

pnpm

What operating system are you using?

Windows [WSL]

Describe the Bug

The addition of Preact leads to an error:

hp@DESKTOP-H1T4LNI MINGW64 ~/My Repositories/personal/peppered-pen (main)
$ pnpm astro add preact

> @example/[email protected] astro C:\Users\hp\My Repositories\personal\peppered-pen
> astro "add" "preact"

⠋ Resolving packages...(node:9628) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
✔ Resolving packages...

  Astro will run the following command:
  If you skip this step, you can always run it yourself later

 ╭──────────────────────────────────────────╮
 │ pnpm add @astrojs/preact preact@^10.6.5  │
 ╰──────────────────────────────────────────╯

√ Continue? ... yes
✔ Installing dependencies...
 error   Failed to resolve entry for package "estree-walker". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "estree-walker" package    
  File:
    C:\Users\hp\My Repositories\personal\peppered-pen\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-67e7f8ab.js:34100:11
  Code:
      34099 | function packageEntryFailure(id, details) {
    > 34100 |     throw new Error(`Failed to resolve entry for package "${id}". ` +
            |           ^
      34101 |         `The package may have incorrect main/module/exports specified in its package.json` +
      34102 |         (details ? ': ' + details : '.'));
      34103 | }

  Stacktrace:
Error: Failed to resolve entry for package "estree-walker". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "estree-walker" package      
    at packageEntryFailure (file:///C:/Users/hp/My%20Repositories/personal/peppered-pen/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:34100:11)
    at resolvePackageEntry (file:///C:/Users/hp/My%20Repositories/personal/peppered-pen/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:34095:9)
    at tryNodeResolve (file:///C:/Users/hp/My%20Repositories/personal/peppered-pen/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:33838:20)
    at viteResolve (file:///C:/Users/hp/My%20Repositories/personal/peppered-pen/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:53085:26)
    at Function._resolveFilename (file:///C:/Users/hp/My%20Repositories/personal/peppered-pen/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:53105:32)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\hp\My Repositories\personal\peppered-pen\node_modules\.pnpm\[email protected]\node_modules\estree-util-build-jsx\lib\index.js:23:28)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)

 ELIFECYCLE  Command failed with exit code 1.

Not sure how to replicate this in stackblitz.

Link to Minimal Reproducible Example

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions