Last active
August 12, 2024 18:27
-
-
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' '
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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