Skip to content

Vitejs Error #51

@nutheory

Description

@nutheory

Following all the install instructions (I've checked and re-checked 10 times at least). I get the following error running ....

mix assets.build

build
tsc && vite build

vite v7.1.12 building for production...
transforming...
✓ 11 modules transformed.
✗ Build failed in 113ms
error during build:
[vite]: Rollup failed to resolve import "react" from "/Users/nutheory/code/ex_chemists/deps/live_react/assets/js/live_react/hooks.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at viteLog (file:///Users/nutheory/code/ex_chemists/assets/node_modules/vite/dist/node/chunks/config.js:33865:57)
at file:///Users/nutheory/code/ex_chemists/assets/node_modules/vite/dist/node/chunks/config.js:33899:73
at onwarn (file:///Users/nutheory/code/ex_chemists/assets/node_modules/@vitejs/plugin-react/dist/index.js:76:7)
at file:///Users/nutheory/code/ex_chemists/assets/node_modules/vite/dist/node/chunks/config.js:33899:28
at onRollupLog (file:///Users/nutheory/code/ex_chemists/assets/node_modules/vite/dist/node/chunks/config.js:33894:63)
at onLog (file:///Users/nutheory/code/ex_chemists/assets/node_modules/vite/dist/node/chunks/config.js:33697:4)
at file:///Users/nutheory/code/ex_chemists/assets/node_modules/rollup/dist/es/shared/node-entry.js:20937:32
at Object.logger [as onLog] (file:///Users/nutheory/code/ex_chemists/assets/node_modules/rollup/dist/es/shared/node-entry.js:22823:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/nutheory/code/ex_chemists/assets/node_modules/rollup/dist/es/shared/node-entry.js:21567:26)
at file:///Users/nutheory/code/ex_chemists/assets/node_modules/rollup/dist/es/shared/node-entry.js:21525:26
** (exit) 1
(mix 1.18.4) lib/mix/tasks/cmd.ex:74: Mix.Tasks.Cmd.run/1
(mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.18.4) lib/mix/task.ex:561: Mix.Task.run_alias/6
(mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2
/Users/nutheory/.asdf/installs/elixir/1.18.4-otp-27/bin/mix:2: (file)

... and if i try to run the app in the browser i get a similar vite error except it complains about "import 'react-dom/client'"...

everything looks right in deps and node_modules as far as i can see??? any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions