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

Bug: yarn package and yarn dev fails on latest versions of Nodejs #820

Closed
uwla opened this issue Dec 13, 2023 · 3 comments
Closed

Bug: yarn package and yarn dev fails on latest versions of Nodejs #820

uwla opened this issue Dec 13, 2023 · 3 comments
Labels
bug Something isn't working up for grabs Anyone can work on this

Comments

@uwla
Copy link
Contributor

uwla commented Dec 13, 2023

Describe the bug

The npm scripts package and dev fails in Artix/Arch Linux in a fresh installation of Polar.

❯ yarn package
yarn run v1.22.19
$ yarn build && yarn package:electron
$ tsc -p electron/tsconfig.json && yarn theme
$ yarn theme:light && yarn theme:dark
$ lessc --include-path=node_modules --js ./src/theme/light.less ./public/themes/light.css
$ lessc --include-path=node_modules --js ./src/theme/dark.less ./public/themes/dark.css
$ cross-env CI=false PUBLIC_URL=./ rescripts build
node:internal/modules/cjs/loader:598
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /path/to/polar/node_modules/postcss-safe-parser/node_modules/postcss/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/path/to/polar/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v21.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

  1. Run Artix/Arch Linux (via VirtualBox, Qemu, Docker, Podman, or any virtualization technology).
  2. Install yarn, nodejs, git, etc.
  3. Clone Polar: 'git clone https://github.com/jamaljsr/polar ~/polar'
  4. Install dependencies with yarn
  5. Try running yarn package or yarn dev. It fails

Expected behavior

The commands yarn package and yarn dev should run successfully in a fresh installation in Artix/Arch Linux.

Desktop (please complete the following information):

  • OS: Artix/Arch Linux
  • Polar Version: latest master branch
  • Docker Version: does not apply
  • Docker Compose Version: does not apply
  • Yarn version: 1.22.19
  • Node version: v21.2.0

Additional context

I'm trying to set up local environment for development. I want to contribute to polar, but can't get it to run.

@uwla uwla added the bug Something isn't working label Dec 13, 2023
@jamaljsr
Copy link
Owner

Yes, this happens on the latest versions of NodeJS. Unfortunately, you have to use the outdated node v16 to run it in dev mode. This is something that I really need to fix asap since v16 is now EOL.

@jamaljsr jamaljsr added the up for grabs Anyone can work on this label Dec 19, 2023
@uwla uwla changed the title Bug: yarn package and yarn dev fails in Artix Linux Bug: yarn package and yarn dev fails on latest versions of Nodejs Dec 28, 2023
@kelvinator07
Copy link
Contributor

Created a PR for this issue: #827

@kelvinator07
Copy link
Contributor

Hi @uwla, This Has Been Resolved And Can Be Closed.

@uwla uwla closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working up for grabs Anyone can work on this
Projects
None yet
Development

No branches or pull requests

3 participants