Comments (3)
Can you provide a repro?
This doesn't reproduce it:
import { yes } from "./space in imported file";
export function test() {
if (!yes) {
throw new Error("no");
}
return testDone(import.meta.url);
}
// space in imported file.js
export const yes = true;
from bun.
I meant in the path of the project itself, sorry for not being precise.
To reproduce simply copy one of your example in a directory that contain a space i.e.: /path/with some spaces/app
& insert a scripts in your package.json
project directory
/srv/projects/open source/examples/next
package.json
{
"name": "@bun-examples/next",
"version": "0.0.37",
"main": "index.js",
"scripts": {
"next": "next --help"
},
"dependencies": {
"next": "11.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2"
},
"devDependencies": {
"@types/react": "^17.0.19",
"bun-framework-next": "^0.0.0-21",
"typescript": "^4.3.5"
},
"bun-create": {
"postinstall": [
"bun bun --use next"
]
}
}
bash
bun run next
$ next --help
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/srv/projects/open'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
As you can see bun is trying to find the module at /srv/projects/open
instead of /srv/projects/open source/examples/next
.
I tried to look around & I suspect the bug lies somewhere in resolve_path.zig or wherever you pass the base_path
/ current_path
arguments for the various functions within that file but to be honest I had never heard of zig before a few days ago so I'm not familiar at all with Zig & might be wrong.
from bun.
Haven’t forgotten about this, will get to it when I can
from bun.
Related Issues (20)
- [windows] non-ascii file path entry point test failure
- [windows] Support `file:` imports
- [windows] why isn't BigInt a constructor? HOT 1
- [windows] Fix inspect tests
- [windows] Undici test is panicking
- [windows] Heap corruption in Buffer test
- [windows] Decorators are not working due to undefined `BUN_RUNTIME` variable
- [windows] setInterval test is panicking
- [windows] BroadcastChannel test crashes HOT 1
- [windows] TextDecoder test is failing
- [windows] Support `file:` URLs
- [Windows] bun doesn't show anything on stdout HOT 3
- Unable to override `process.env.NODE_ENV`
- bun unable to create astro project HOT 1
- Suggest missing package install command in console
- bun:ffi corrupts some double values passed as arguments
- `process.on("exit")` isn't triggered with `bun test`
- emitDecoratorMetadata fails when interfaces are imported without `import type` HOT 6
- [sourcemaps?] Error message points at wrong variable
- `Bun.file().writer` should work with `Symbol.dispose`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.