-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Description
Describe the bug
I have a package.json like
{
"name": "use-github-react-js",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"use-github": "file:../.."
},
"devDependencies": {
"@vitejs/plugin-react": "^1.0.7",
"vite": "^2.8.0"
}
}The important part is where I import use-github, it's being defined like that because the project is located in an example directory, it's important to mention that this project is not a monorepo!
Reproduction
https://github.com/UltiRequiem/use-github/tree/main/examples/use-github-react-js
System Info
System:
OS: Linux 5.16 Arch Linux
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 12.17 GB / 15.42 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 17.6.0 - /usr/bin/node
Yarn: 1.22.15 - /usr/bin/yarn
npm: 8.5.2 - /usr/bin/npm
Browsers:
Brave Browser: 98.1.35.103
Firefox: 97.0.1Used Package Manager
pnpm
Logs
The problem occurs on the browser, the build is successful
Uncaught ReferenceError: exports is not defined
at index.js:16:23index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./user"), exports);
__exportStar(require("./pinned-repos"), exports);Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable