Skip to content

Instantly share code, notes, and snippets.

@superboum
Last active August 12, 2024 18:27
Show Gist options
  • Save superboum/1d59a67290a3224d83fbc5cb7f97fb03 to your computer and use it in GitHub Desktop.
Save superboum/1d59a67290a3224d83fbc5cb7f97fb03 to your computer and use it in GitHub Desktop.
Reproduce vite error 'Uncaught SyntaxError: The requested module X does not provide an export named 'default' '
FROM node:22
WORKDIR /srv
COPY rep.sh .
RUN chmod +x rep.sh
RUN ./rep.sh
WORKDIR /srv/vite-bug
CMD [ "yarn", "dev", "--host", "0.0.0.0" ]
#!/usr/bin/env bash
set -euxo pipefail
yarn --version
mkdir ts-enum
cd ts-enum
yarn init --yes
echo "export enum Status { GREEN = 'GREEN' }" > status.ts
cd ..
yarn create vite vite-bug --template vanilla-ts
cd vite-bug
yarn config set nodeLinker node-modules
yarn add ts-enum@file:./../ts-enum
yarn install
echo "import { Status } from 'ts-enum/status'" > src/main.ts
echo 'console.log(Status.GREEN)' >> src/main.ts
yarn build
# Run `yarn dev` now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment