Skip to content

picomatch/posix.js does not provide an export 'default' on new install via CLI. #404

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

Closed
x8BitRain opened this issue Nov 5, 2024 · 4 comments · Fixed by #406
Closed

picomatch/posix.js does not provide an export 'default' on new install via CLI. #404

x8BitRain opened this issue Nov 5, 2024 · 4 comments · Fixed by #406
Labels
bug Something isn't working

Comments

@x8BitRain
Copy link

Describe the bug

Initing a new project via npm create tutorial and starting the project results in

[astro-island] Error hydrating /node_modules/@tutorialkit/astro/dist/default/components/WorkspacePanelWrapper.tsx SyntaxError: The requested module '/node_modules/picomatch/posix.js?v=376cec49' does not provide an export named 'default' (at tutorial-runner.js?v=376cec49:1:8)

in the browser, without any modification to the project.

The demo project does not start and is stuck on "Preparing Environment".

This happens with npm, pnpm and bun, also tried to manually install picomatch and create a vite alias without success.

Link to a StackBlitz project which shows the error

No response

Steps to reproduce

  1. Run npm create tutorial, enter all default options
  2. Wait for localhost to open in browser
  3. check console.

Expected behavior

The default project should start without error.

Screenshots

image

Platform

  • TutorialKit version: 4.15.0
  • OS: Macos
  • Browser: Lastest chrome
  • Version: 131

Additional context

No response

@AriPerkkio AriPerkkio added the bug Something isn't working label Nov 5, 2024
@AriPerkkio
Copy link
Member

AriPerkkio commented Nov 5, 2024

This was introduced in version 1.2.0 in #394. The version 1.1.1 should work fine.

Looks like also pnpm build; pnpm preview works just fine, it's just the development mode pnpm dev when Vite fails to resolve default export for the CJS depedency. 🤔

@AriPerkkio
Copy link
Member

AriPerkkio commented Nov 5, 2024

Another work-around for now is to add this in your astro.config.ts:

import tutorialkit from "@tutorialkit/astro";
import { defineConfig } from "astro/config";

export default defineConfig({
  devToolbar: {
    enabled: false,
  },
  integrations: [tutorialkit()],
+ vite: {
+   optimizeDeps: {
+     include: ["@tutorialkit/astro > picomatch/posix.js"],
+   },
+ },
});

@AriPerkkio
Copy link
Member

Fixed in version 1.2.1.

@innerdaze
Copy link

Still have this issue when using yarn 1.22 - upgrading to latest yarn resolves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants