summaryrefslogtreecommitdiff
path: root/tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-11 13:18:19 -0400
committerGitHub <noreply@github.com>2024-04-11 13:18:19 -0400
commitdf73db671beada623a937bf4aad28a486d397971 (patch)
tree5242df73dc27b762cd61f124c986751859e59ba9 /tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx
parent061bcb53937548673fdaae0721a169018d322f7b (diff)
fix(npm): local nodeModulesDir was sometimes resolving duplicates of same package (#23320)
Diffstat (limited to 'tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx')
-rw-r--r--tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx b/tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx
new file mode 100644
index 000000000..efb95ec90
--- /dev/null
+++ b/tests/specs/npm/local_dir_no_duplicate_resolution/main.tsx
@@ -0,0 +1,10 @@
+// this previously was ending up with two preacts and would crash
+import { useMemo } from "preact/hooks";
+import renderToString from "preact-render-to-string";
+
+function Test() {
+ useMemo(() => "test", []);
+ return <div>Test</div>;
+}
+
+const html = renderToString(<Test />);