Error building wasm-runtime: ERR_PACKAGE_PATH_NOT_EXPORTED

error trying to deploy the wasm runtime: GitHub - second-state/netlify-wasm-runtime: A template project for building high-performance, portable, and safe serverless functions in Netlify.
error: 4:36:45 PM: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath “./lib/parser” is not defined by “exports” in /opt/build/repo/node_modules/next/node_modules/postcss/

  • We need to know your netlify site name: netlify-wasm-runtime-waxc-netlify.app
  • try Ask Netlify AI but unable to find resolution.
  • Build problems: Link or paste the FULL build log & build settings screenshot:
4:36:14 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
4:36:14 PM: buildbot version: 742cd4f739071a396139ba5020a96a927941b57d
4:36:14 PM: Fetching cached dependencies
4:36:14 PM: Failed to fetch cache, continuing with build
4:36:14 PM: Starting to prepare the repo for build
4:36:14 PM: No cached dependencies found. Cloning fresh repo
4:36:14 PM: git clone --filter=blob:none https://github.com/man-chi/netlify-wasm-runtime
4:36:14 PM: Preparing Git Reference refs/heads/main
4:36:15 PM: Custom functions path detected. Proceeding with the specified path: "api"
4:36:16 PM: Starting to install dependencies
4:36:16 PM: Python version set to 3.8
4:36:16 PM: Attempting Ruby version 2.7.2, read from environment
4:36:16 PM: Using Ruby version 2.7.2
4:36:17 PM: Started restoring cached go cache
4:36:17 PM: Finished restoring cached go cache
4:36:18 PM: go version go1.19.13 linux/amd64
4:36:18 PM: Using PHP version 8.0
4:36:19 PM: Downloading and installing node v18.19.1...
4:36:19 PM: Downloading https://nodejs.org/dist/v18.19.1/node-v18.19.1-linux-x64.tar.xz...
4:36:20 PM: Computing checksum with sha256sum
4:36:20 PM: Checksums matched!
4:36:22 PM: Now using node v18.19.1 (npm v10.2.4)
4:36:22 PM: Enabling Node.js Corepack
4:36:22 PM: Started restoring cached build plugins
4:36:22 PM: Finished restoring cached build plugins
4:36:22 PM: Started restoring cached corepack dependencies
4:36:22 PM: Finished restoring cached corepack dependencies
4:36:22 PM: Started restoring cached yarn cache
4:36:22 PM: Finished restoring cached yarn cache
4:36:22 PM: No yarn workspaces detected
4:36:22 PM: Started restoring cached node modules
4:36:22 PM: Finished restoring cached node modules
4:36:22 PM: Installing npm packages using Yarn version 1.22.19
4:36:23 PM: yarn install v1.22.19
4:36:23 PM: [1/4] Resolving packages...
4:36:23 PM: [2/4] Fetching packages...
4:36:25 PM: [3/4] Linking dependencies...
4:36:26 PM: [4/4] Building fresh packages...
4:36:26 PM: success Saved lockfile.
4:36:26 PM: Done in 3.28s.
4:36:26 PM: npm packages installed using Yarn
4:36:27 PM: Successfully installed dependencies
4:36:27 PM: Starting build script
4:36:27 PM: Detected 1 framework(s)
4:36:27 PM: "next" at version "10.1.3"
4:36:27 PM: Section completed: initializing
4:36:29 PM: ​
4:36:29 PM: Netlify Build                                                 
4:36:29 PM: ────────────────────────────────────────────────────────────────
4:36:29 PM: ​
4:36:29 PM: ❯ Version
4:36:29 PM:   @netlify/build 29.36.0
4:36:29 PM: ​
4:36:29 PM: ❯ Flags
4:36:29 PM:   baseRelDir: true
4:36:29 PM:   buildId: 65dafbf28238d7a7128f1cfe
4:36:29 PM:   deployId: 65dafbf28238d7a7128f1d00
4:36:29 PM: ​
4:36:29 PM: ❯ Current directory
4:36:29 PM:   /opt/build/repo
4:36:29 PM: ​
4:36:29 PM: ❯ Config file
4:36:29 PM:   /opt/build/repo/netlify.toml
4:36:29 PM: ​
4:36:29 PM: ❯ Context
4:36:29 PM:   production
4:36:29 PM: ​
4:36:29 PM: ❯ Installing plugins
4:36:29 PM:    - @netlify/plugin-nextjs@4.41.3
4:36:43 PM: ​
4:36:43 PM: ❯ Using Next.js Runtime - v4.41.3
4:36:44 PM: ​
4:36:44 PM: @netlify/plugin-nextjs (onPreBuild event)                     
4:36:44 PM: ────────────────────────────────────────────────────────────────
4:36:44 PM: ​
4:36:44 PM: No Next.js cache to restore.
4:36:44 PM: ​
4:36:44 PM: (@netlify/plugin-nextjs onPreBuild completed in 61ms)
4:36:44 PM: ​
4:36:44 PM: Build command from Netlify app                                
4:36:44 PM: ────────────────────────────────────────────────────────────────
4:36:44 PM: ​
4:36:44 PM: $ yarn run build
4:36:44 PM: yarn run v1.22.19
4:36:44 PM: $ next build && cd api && ./pre.sh
4:36:45 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
4:36:45 PM: Browserslist: caniuse-lite is outdated. Please run:
4:36:45 PM: npx browserslist@latest --update-db
4:36:45 PM: Why you should do it regularly:
4:36:45 PM: https://github.com/browserslist/browserslist#browsers-data-updating
4:36:45 PM: node:internal/errors:496
4:36:45 PM:     ErrorCaptureStackTrace(err);
4:36:45 PM:     ^
4:36:45 PM: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath "./lib/parser" is not defined by "exports" in /opt/build/repo/node_modules/next/node_modules/postcss/package.json
4:36:45 PM:     at new NodeError (node:internal/errors:405:5)
4:36:45 PM:     at exportsNotFound (node:internal/modules/esm/resolve:366:10)
4:36:45 PM:     at packageExportsResolve (node:internal/modules/esm/resolve:713:9)
4:36:45 PM:     at resolveExports (node:internal/modules/cjs/loader:584:36)
4:36:45 PM:     at Module._findPath (node:internal/modules/cjs/loader:658:31)
4:36:45 PM:     at Module._resolveFilename (node:internal/modules/cjs/loader:1120:27)
4:36:45 PM:     at Module._load (node:internal/modules/cjs/loader:975:27)
4:36:45 PM:     at Module.require (node:internal/modules/cjs/loader:1225:19)
4:36:45 PM:     at require (node:internal/modules/helpers:177:18)
4:36:45 PM:     at 552 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
4:36:45 PM:     at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
4:36:45 PM:     at 270 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
4:36:45 PM:     at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
4:36:45 PM:     at 327 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
4:36:45 PM:     at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
4:36:45 PM:     at 845 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
4:36:45 PM:   code: "ERR_PACKAGE_PATH_NOT_EXPORTED"
4:36:45 PM: }
4:36:45 PM: Node.js v18.19.1
4:36:45 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
4:36:45 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
4:36:45 PM: ​
4:36:45 PM: "build.command" failed                                        
4:36:45 PM: ────────────────────────────────────────────────────────────────
4:36:45 PM: ​
4:36:45 PM:   Error message
4:36:45 PM:   Command failed with exit code 1: yarn run build (https://ntl.fyi/exit-code-1)
4:36:45 PM: ​
4:36:45 PM:   Error location
4:36:45 PM:   In Build command from Netlify app:
4:36:45 PM:   yarn run build
4:36:45 PM: ​
4:36:45 PM:   Resolved config
4:36:45 PM:   build:
4:36:45 PM:     command: yarn run build
4:36:45 PM:     commandOrigin: ui
4:36:45 PM:     environment:
4:36:45 PM:       - NEXT_PRIVATE_TARGET
4:36:45 PM:     publish: /opt/build/repo/.next
4:36:45 PM:     publishOrigin: ui
4:36:45 PM:   functions:
4:36:45 PM:     "*":
4:36:45 PM:       included_files:
4:36:45 PM:         - api/**
      node_bundler: esbuild
  functionsDirectory: /opt/build/repo/api
  plugins:
    - inputs: {}
      origin: ui
      package: "@netlify/plugin-nextjs"
4:36:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:36:45 PM: Failing build: Failed to build site
4:36:45 PM: Finished processing build request in 31.846s

Looks like a problem with the package than Netlify. Does this work locally? Could you share your local build logs if it works?

thanks for your reply. meanwhile, I am still trying to set up my local env, will get back to you shortly.