Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New project doesn't work #2754

Open
alexei opened this issue Nov 27, 2023 · 3 comments
Open

New project doesn't work #2754

alexei opened this issue Nov 27, 2023 · 3 comments

Comments

@alexei
Copy link

alexei commented Nov 27, 2023

Initialising a new project with npm init @open-wc sets up a project that doesn't work.

When running yarn install, one gets warned that two packages are missing:

  • @babel/core, required by @rollup/plugin-babel and @babel/preset-env
  • esbuild, required by rollup-plugin-esbuild

Then yarn run lint and yarn run format have missing packages as well, and one has to run the commands repeatedly to figure out the next package they should install:

  • eslint-plugin-wc
  • eslint-plugin-lit-a11y
  • eslint-plugin-lit
  • eslint-plugin-html
  • eslint-plugin-no-only-tests
  • eslint-plugin-import
  • @babel/plugin-syntax-import-assertions

yarn run test requires @web/test-runner-playwright and playwright which are of course missing. Besides, the template seems to create a web-test-runner.config.js and a web-test-runner.config.mjs, though only one is needed. Perhaps one should be warned that web-test-runner.config.mjs takes priority and updating web-test-runner.config.js while keeping around the other has no effect. On another note, the imports in the config file are commented out for some reason.

yarn run analyze doesn't work: sh: cem: command not found. Only God knows what cem is! I suppose it has to do with @custom-elements-manifest/analyzer, which exists as a dependency, but somehow doesn't provide a cem command. And because yarn run build and some other coomands also run analyze, they fail too.

yarn run storybook doesn't work either, even if you drop the analyze part: a prismjs package is missing, and two required files don't exist, .storybook/server.mjs and .storybook/main.js respectively. I initialised them using the sample code at https://modern-web.dev/guides/dev-server/storybook/ and I got yet another error:

Error: require() of ES Module .../.storybook/main.js from .../node_modules/@web/dev-server-storybook/dist/shared/config/readStorybookConfig.js not supported.

I've no idea what that means and at this time I'm too tired to look it up on the Internet.

Are there any plans to making it work?

@Westbrook
Copy link
Contributor

@najikahalsema has been looking at catching up various version and configs herein. Hopefully have an update in the next couple of weeks.

@AntonyF-Andreani
Copy link

AntonyF-Andreani commented Dec 7, 2023

This looks that problem of peerDependencies ? (yarn doesnt install automatically).

In my case test with pnpm and doesnt work.

To work respectivelly with npm and then install @types/mocha as devDependecy and works fine.

To work storybook I need to add a package.json in .storybook folder.

{
  "type": "commonjs"
}

@Kikketer
Copy link

Kikketer commented Feb 1, 2024

Thanks @AntonyF-Andreani that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants