forked from sjrd/scalajs-sbt-vite-laminar-chartjs-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move resources to
web
which leads to bug
1. Move several files to `web`. 2. Update vite config to point to the current location. ``` 6:48:53 PM [vite] Internal server error: Failed to resolve import "react" from "../target/scala-3.2.2/livechart-fastopt/livechart.LiveChart$package$.js". Does the file exist? Plugin: vite:import-analysis File: /Users/brunohenriques/workspace/issue-rd-scalajs-sbt-vite-laminar-chartjs-example/target/scala-3.2.2/livechart-fastopt/livechart.LiveChart$package$.js:3:28 1 | 'use strict'; 2 | import * as $i_$002fjavascript$002esvg from "/javascript.svg"; 3 | import * as $i_react from "react"; | ^ 4 | import * as $i_react$002ddom$002fclient from "react-dom/client"; 5 | import * as $j_internal$002d3ebfae0cba70adf981029a0da5b1e4b5ab5d02c6 from "./internal-3ebfae0cba70adf981029a0da5b1e4b5ab5d02c6.js"; ```
- Loading branch information
1 parent
6c7b188
commit 33cf7c2
Showing
10 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Reproduces an issue where vite gets confused where external `node_modules` are. | ||
|
||
The project starts from the end of the [ScalaJS vite tutorial](https://www.scala-js.org/doc/tutorial/scalajs-vite.html), | ||
then: | ||
1. Stable: Migrate to Slinky's `main` branch that supports React 18 (previous commit). | ||
2. Buggy: Move several resources to the `web` folder (current commit). | ||
|
||
## How to reproduce | ||
Terminal 1: | ||
- Run `sbt "~fastLinkJS"` | ||
|
||
- Terminal 2: | ||
- Go to `web` | ||
- Run `npm install` | ||
- Run `npm run dev` | ||
|
||
## Workaround | ||
|
||
While it is running with the bug, run the following at the root: | ||
``` | ||
cp -r web/node_modules . | ||
``` |
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
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
IntelliJ renamed this out-of-the-blue. No harm but annoying.