Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
4d4637fd
Commit
4d4637fd
authored
Aug 22, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repro the libsql issue
parent
e0c65232
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
5 deletions
+82
-5
lib.rs
turbopack/crates/turbopack-ecmascript/src/lib.rs
+1
-1
execution.rs
turbopack/crates/turbopack-tests/tests/execution.rs
+7
-3
snapshot.rs
turbopack/crates/turbopack-tests/tests/snapshot.rs
+2
-1
README
...ck-tests/tests/snapshot/dynamic-require/input/deps/README
+2
-0
cake.js
...k-tests/tests/snapshot/dynamic-require/input/deps/cake.js
+1
-0
index.js
...opack-tests/tests/snapshot/dynamic-require/input/index.js
+5
-0
Parsing ecmascript source code failed-8ddb1b.txt
...e/issues/Parsing ecmascript source code failed-8ddb1b.txt
+13
-0
aaf3a_crates_turbopack-tests_tests_snapshot_dynamic-require_input_index_edad95b4.js.map
...ests_snapshot_dynamic-require_input_index_edad95b4.js.map
+5
-0
ba425_crates_turbopack-tests_tests_snapshot_dynamic-require_input_index_edad95b4.js
...ts_tests_snapshot_dynamic-require_input_index_edad95b4.js
+5
-0
turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js
...-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js
+34
-0
turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js.map
...ts_tests_snapshot_dynamic-require_input_4f7fc346._.js.map
+7
-0
No files found.
turbopack/crates/turbopack-ecmascript/src/lib.rs
View file @
4d4637fd
...
...
@@ -1826,7 +1826,7 @@ async fn process_parse_result(
}
ParseResult
::
NotFound
=>
{
let
path
=
ident
.path
()
.to_string
()
.await
?
;
let
msg
=
format!
(
"Could not parse module '{path}'"
);
let
msg
=
format!
(
"Could not parse module '{path}'
, file not found
"
);
let
body
=
vec!
[
quote!
(
"const e = new Error($msg);"
as
Stmt
,
...
...
turbopack/crates/turbopack-tests/tests/execution.rs
View file @
4d4637fd
...
...
@@ -102,8 +102,12 @@ fn register() {
//
// "Skip" directories named `__skipped__`, which include test directories to
// skip.
#[testing
::
fixture(
"tests/execution/*/*/*"
,
exclude(
"node_modules|__skipped__"
))]
#[testing
::
fixture(
"tests/execution/**/input/index.js"
,
exclude(
"node_modules|__skipped__"
)
)]
fn
test
(
resource
:
PathBuf
)
{
let
resource
=
resource
.parent
()
.unwrap
()
.parent
()
.unwrap
()
.to_path_buf
();
let
messages
=
get_messages
(
run
(
resource
,
IssueSnapshotMode
::
Snapshots
)
.unwrap
());
if
!
messages
.is_empty
()
{
panic!
(
...
...
@@ -113,10 +117,10 @@ fn test(resource: PathBuf) {
}
}
#[testing
::
fixture(
"tests/execution/*/*/__skipped__/*/input"
)]
#[testing
::
fixture(
"tests/execution/*/*/__skipped__/*/input
/index.js
"
)]
#[should_panic]
fn
test_skipped_fails
(
resource
:
PathBuf
)
{
let
resource
=
resource
.parent
()
.unwrap
()
.to_path_buf
();
let
resource
=
resource
.parent
()
.unwrap
()
.
parent
()
.unwrap
()
.
to_path_buf
();
let
JsResult
{
// Ignore uncaught exceptions for skipped tests.
...
...
turbopack/crates/turbopack-tests/tests/snapshot.rs
View file @
4d4637fd
...
...
@@ -168,9 +168,10 @@ fn is_empty_dir_tree(dir_entries: impl IntoIterator<Item = io::Result<fs::DirEnt
true
}
#[testing
::
fixture(
"tests/snapshot/*/
*/
"
,
exclude(
"node_modules"
))]
#[testing
::
fixture(
"tests/snapshot/*/
input/index.js
"
,
exclude(
"node_modules"
))]
fn
test
(
resource
:
PathBuf
)
{
let
resource
=
canonicalize
(
resource
)
.unwrap
();
let
resource
=
resource
.parent
()
.unwrap
()
.parent
()
.unwrap
()
.to_path_buf
();
let
mut
has_output_dir
=
false
;
let
contents
=
fs
::
read_dir
(
&
resource
)
...
...
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README
0 → 100644
View file @
4d4637fd
This was a triumph
I'm making a note here, "Great Success"
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js
0 → 100644
View file @
4d4637fd
exports
.
cake
=
'The cake is a like'
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/index.js
0 → 100644
View file @
4d4637fd
function
get
(
name
)
{
return
require
(
`./deps/
${
name
}
`
)
}
console
.
log
(
get
(
'cake'
).
cake
)
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/issues/Parsing ecmascript source code failed-8ddb1b.txt
0 → 100644
View file @
4d4637fd
error - [analysis] /turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README:1:5 Parsing ecmascript source code failed
+ v-v
1 + This was a triumph
+ ^-^
2 | I'm making a note here, "Great Success"
3 |
Expected ';', '}' or <eof>
Import trace:
test:
./turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README
./turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/index.js
\ No newline at end of file
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/output/aaf3a_crates_turbopack-tests_tests_snapshot_dynamic-require_input_index_edad95b4.js.map
0 → 100644
View file @
4d4637fd
{
"version": 3,
"sources": [],
"sections": []
}
\ No newline at end of file
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/output/ba425_crates_turbopack-tests_tests_snapshot_dynamic-require_input_index_edad95b4.js
0 → 100644
View file @
4d4637fd
(
globalThis
.
TURBOPACK
||
(
globalThis
.
TURBOPACK
=
[])).
push
([
"output/ba425_crates_turbopack-tests_tests_snapshot_dynamic-require_input_index_edad95b4.js"
,
{
"otherChunks"
:[
"output/turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js"
],
"runtimeModuleIds"
:[
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/index.js [test] (ecmascript)"
]}
]);
// Dummy runtime
\ No newline at end of file
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/output/turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js
0 → 100644
View file @
4d4637fd
(
globalThis
.
TURBOPACK
||
(
globalThis
.
TURBOPACK
=
[])).
push
([
"output/turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js"
,
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README [test] (ecmascript)"
,
((
__turbopack_context__
,
module
,
exports
)
=>
{
const
e
=
new
Error
(
"Could not parse module '[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README'
\n\n
Expected ';', '}' or <eof>"
);
e
.
code
=
'MODULE_UNPARSABLE'
;
throw
e
;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js [test] (ecmascript)"
,
((
__turbopack_context__
,
module
,
exports
)
=>
{
exports
.
cake
=
"The cake is a like"
;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/index.js [test] (ecmascript)"
,
((
__turbopack_context__
,
module
,
exports
)
=>
{
function
get
(
name
)
{
return
__turbopack_context__
.
f
({
"./deps/README"
:
{
id
:
()
=>
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README [test] (ecmascript)"
,
module
:
()
=>
__turbopack_context__
.
r
(
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/README [test] (ecmascript)"
)
},
"./deps/cake"
:
{
id
:
()
=>
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js [test] (ecmascript)"
,
module
:
()
=>
__turbopack_context__
.
r
(
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js [test] (ecmascript)"
)
},
"./deps/cake.js"
:
{
id
:
()
=>
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js [test] (ecmascript)"
,
module
:
()
=>
__turbopack_context__
.
r
(
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js [test] (ecmascript)"
)
}
})(
`./deps/
${
name
}
`
);
}
console
.
log
(
get
(
'cake'
).
cake
);
}),
]);
//# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js.map
\ No newline at end of file
turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/output/turbopack_crates_turbopack-tests_tests_snapshot_dynamic-require_input_4f7fc346._.js.map
0 → 100644
View file @
4d4637fd
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/deps/cake.js"],"sourcesContent":["exports.cake = \"The cake is a like\""],"names":[],"mappings":"AAAA,QAAQ,IAAI,GAAG"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-require/input/index.js"],"sourcesContent":["function get(name) {\n return require(`./deps/${name}`)\n}\n\nconsole.log(get('cake').cake)\n"],"names":[],"mappings":"AAAA,SAAS,IAAI,IAAI;IACf;;;;;;;;;;;;;OAAe,CAAC,OAAO,EAAE,MAAM;AACjC;AAEA,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI"}}]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment