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

node_modules in dist folder #7933

Closed
1 task
lorenzolewis opened this issue Aug 3, 2023 · 1 comment · Fixed by #8092
Closed
1 task

node_modules in dist folder #7933

lorenzolewis opened this issue Aug 3, 2023 · 1 comment · Fixed by #8092
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@lorenzolewis
Copy link
Contributor

What version of astro are you using?

2.10.0

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

None

What package manager are you using?

pnpm

What operating system are you using?

macOS

What browser are you using?

N/A (build related)

Describe the Bug

This is related to the Starlight integration but appears to be an issue with Astro itself. This only showed up for Astro versions 2.5.6 and AFTER. 2.5.5 and before run as expected.

There appear to be 2 files that aren't cleaned up as part of running pnpm astro build:

  • dist/node_modules/.pnpm/@astrojs+starlight@0.6.1_astro@2.10.0/node_modules/@astrojs/starlight/404.astro.mjs
  • dist/node_modules/.pnpm/@astrojs+starlight@0.6.1_astro@2.10.0/node_modules/@astrojs/starlight/index.astro.mjs

The content inside the index.astro.mjs looks like this:

export { renderers } from '../../../../../../renderers.mjs';
export { onRequest } from '../../../../../../_empty-middleware.mjs';
import '../../../../../../chunks/astro.2c0550c5.mjs';

const page = () => import('../../../../../../chunks/pages/index.astro.301b0b80.mjs');

export { page };

The contents of 404.astro.mjs is the same but referencing the 404 files instead.

Note: I wasn't able to get this to reproduce in Stackblitz but got it locally on a macOS M1 Pro (macOS 13.4 (22F66)) and also on a GitHub Codespace environment.

Original issue in the Starlight repo: withastro/starlight#458
Potentially related: #7397, #7193

What's the expected result?

The node_modules folder shouldn't be included in the dist folder (which is resulting in some downstream tooling thinking a build output parameter isn't configured properly since there's a node_modules folder).

Link to Minimal Reproducible Example

https://github.com/lorenzolewis/starlight-bug-test

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 3, 2023
@matthewp
Copy link
Contributor

matthewp commented Aug 3, 2023

I bet that the code that cleans up ignore dot folders.

@matthewp matthewp added - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs triage Issue needs to be triaged labels Aug 3, 2023
@natemoo-re natemoo-re self-assigned this Aug 15, 2023
natemoo-re added a commit that referenced this issue Aug 16, 2023
* fix(#7933, plt-789): cleanup dotfiles during build

* chore: add changeset
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants