twilio-labs/paste

Fresh Paste app created from template fails to run

hughrawlinson opened this issue · 6 comments

From a fresh install of the paste nextjs template, the yarn dev command doesn't succeed.

To Reproduce

yarn create next-app --example https://github.com/twilio-labs/paste/tree/main/packages/paste-nextjs-template test-site
cd test-site
yarn dev
yarn run v1.22.18
$ next dev
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in /Users/hrawlinson/code/github.com/test-site/node_modules/next/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:377:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:719:3)
    at resolveExports (node:internal/modules/cjs/loader:483:36)
    at Module._findPath (node:internal/modules/cjs/loader:523:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:925:27)
    at Module._load (node:internal/modules/cjs/loader:780:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at 552 (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
    at __webpack_require__ (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at 560 (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
    at __webpack_require__ (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at 290 (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
    at __webpack_require__ (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at 632 (/Users/hrawlinson/code/github.com/test-site/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.

Desktop (please complete the following information):

  • OS: macOS 12.4
  • Browser [e.g. chrome, safari] n/a
  • Version [e.g. 22] n/a
  • CPU Architecture: Intel (2018 MBP)

Additional context
Add any other context about the problem here.

Hi @hughrawlinson ! Can you share what version of node you're on?

It might not work on node 16. You can try node 12 for now. We're working on an update for this!

Ah I think I was on Node 18. Does Node 14 work? Node 12 is in EoL, so I would like to avoid it if possible.

Hi @hughrawlinson we're actually currently working on upgrading that template so it'll work with all the new things. Hopefully it'll get completed soon #2409.

Perfect! I subscribed to that PR 😃 thanks!

Hi @hughrawlinson, wanted to circle back on this.

Due to some related build issues with Next, we ended up resolving this issue w/ PR #2466. This has been merged, and I have verified locally that I can successfully start a new next project with the Paste NextJS template with both Node v18 (18.4.0) as well as v16 (16.15.0).

Can you confirm if things are good on your end? Thanks!

I had actually unblocked myself earlier this week by applying the same changes - but I just tried this now and it works fine for me :) Thanks!