solidjs/templates

[vite] error while updating dependencies...

busticated opened this issue ยท 1 comments

hi again ๐Ÿ‘‹

on macOS v14.1 (23B74) with node@18.18.2 and npm@9.8.1 using the vite.config.js file shown here, i'm seeing a number of errors when i run vitest:

[vite] error while updating dependencies:
Error: Build failed with 17 errors:
node_modules/solid-js/h/dist/h.js:1:17: ERROR: No matching export in "node_modules/solid-js/web/dist/server.js" for import "assign"
node_modules/solid-js/h/dist/h.js:1:50: ERROR: No matching export in "node_modules/solid-js/web/dist/server.js" for import "dynamicProperty"
node_modules/solid-js/h/dist/h.js:1:67: ERROR: No matching export in "node_modules/solid-js/web/dist/server.js" for import "SVGElements"
node_modules/solid-js/html/dist/html.js:1:9: ERROR: No matching export in "node_modules/solid-js/web/dist/server.js" for import "effect"
node_modules/solid-js/html/dist/html.js:1:17: ERROR: No matching export in "node_modules/solid-js/web/dist/server.js" for import "style"
...
    at failureErrorWithLog (/Users/me/code/my-project/node_modules/esbuild/lib/main.js:1649:15)
    at /Users/me/code/my-project/node_modules/esbuild/lib/main.js:1058:25
    at /Users/me/code/my-project/node_modules/esbuild/lib/main.js:1525:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

here are the dependencies i have installed:

>>npm ls --depth=0
knuckles@0.0.0 /Users/me/code/my-project
โ”œโ”€โ”€ @solidjs/testing-library@0.8.4
โ”œโ”€โ”€ @testing-library/jest-dom@6.1.4
โ”œโ”€โ”€ eslint-plugin-solid@0.13.0
โ”œโ”€โ”€ eslint@8.53.0
โ”œโ”€โ”€ jsdom@22.1.0
โ”œโ”€โ”€ solid-devtools@0.29.2
โ”œโ”€โ”€ solid-js@1.8.5
โ”œโ”€โ”€ vite-plugin-solid@2.7.2
โ”œโ”€โ”€ vite@4.5.0
โ””โ”€โ”€ vitest@0.34.6

further, within my test it seems components are not rendering:

import { render, fireEvent } from '@solidjs/testing-library';
import { expect } from 'vitest'
import { Spinner } from './spinner.jsx';


describe('<TodoList />', () => {
	test('It renders', () => {
		const { container, getByTestId } = render(() => <Spinner />);
		console.log('CONTAINER:', container.innerHTML);
		expect(getByTestId('spinner')).toBeInTheDocument();
	});
});

the console.log() call there outputs:

stdout | components/ui/spinner.test.jsx > <TodoList /> > It renders
CONTAINER: 

...which suggested the component is not rendering at all.

oof ๐Ÿคฆ i had the resolve setting in the wrong place. with that as a top-level property (vs. a child of test), things run fine.