Astro build failing to deploy

Am trying to deploy an Astro.build website. As a hobby builder helping my parents-in-law I know very little about deploying. Have no clue how to solve this.

Hypothesis: As I am using a parse module from npm, this module is causing a problem.

  • Netlify site name: ciaa3.netlify.app
  • Github code: https://github.com/onlinemoose/ciaa3

Build log:

10:44:13 AM: Build ready to start
10:44:26 AM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
10:44:26 AM: build-image tag: v4.10.1
10:44:26 AM: buildbot version: f4df34fdee5e467fb0a8a2f62e3840ffaba0a9bc
10:44:26 AM: Fetching cached dependencies
10:44:26 AM: Failed to fetch cache, continuing with build
10:44:26 AM: Starting to prepare the repo for build
10:44:26 AM: No cached dependencies found. Cloning fresh repo
10:44:26 AM: git clone https://github.com/onlinemoose/ciaa3
10:44:27 AM: Preparing Git Reference refs/heads/master
10:44:27 AM: Parsing package.json dependencies
10:44:28 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'netlify/functions' versus '' in the Netlify UI
10:44:28 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npm run build' versus 'astro build' in the Netlify UI
10:44:28 AM: Starting build script
10:44:28 AM: Installing dependencies
10:44:28 AM: Python version set to 2.7
10:44:28 AM: v16.16.0 is already installed.
10:44:29 AM: Now using node v16.16.0 (npm v8.11.0)
10:44:29 AM: Started restoring cached build plugins
10:44:29 AM: Finished restoring cached build plugins
10:44:29 AM: Attempting ruby version 2.7.2, read from environment
10:44:29 AM: Using ruby version 2.7.2
10:44:30 AM: Using PHP version 8.0
10:44:30 AM: No npm workspaces detected
10:44:30 AM: Started restoring cached node modules
10:44:30 AM: Finished restoring cached node modules
10:44:30 AM: Installing NPM modules using NPM version 8.11.0
10:44:30 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:44:30 AM: npm WARN config location in the cache, and they are managed by
10:44:30 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:44:31 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:44:31 AM: npm WARN config location in the cache, and they are managed by
10:44:31 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:44:36 AM: npm WARN deprecated node-pre-gyp@0.13.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
10:44:37 AM: added 587 packages, and audited 588 packages in 7s
10:44:37 AM: 227 packages are looking for funding
10:44:37 AM:   run `npm fund` for details
10:44:37 AM: found 0 vulnerabilities
10:44:37 AM: NPM modules installed
10:44:37 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:44:37 AM: npm WARN config location in the cache, and they are managed by
10:44:37 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:44:37 AM: Started restoring cached go cache
10:44:37 AM: Finished restoring cached go cache
10:44:37 AM: Installing Go version 1.17 (requested 1.17)
10:44:42 AM: unset GOOS;
10:44:42 AM: unset GOARCH;
10:44:42 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
10:44:42 AM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
10:44:42 AM: go version >&2;
10:44:42 AM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
10:44:42 AM: go version go1.17 linux/amd64
10:44:42 AM: Installing missing commands
10:44:42 AM: Verify run directory
10:44:43 AM: ​
10:44:43 AM: ────────────────────────────────────────────────────────────────
10:44:43 AM:   Netlify Build                                                 
10:44:43 AM: ────────────────────────────────────────────────────────────────
10:44:43 AM: ​
10:44:43 AM: ❯ Version
10:44:43 AM:   @netlify/build 27.9.1
10:44:43 AM: ​
10:44:43 AM: ❯ Flags
10:44:43 AM:   baseRelDir: true
10:44:43 AM:   buildId: 62f4cf6d140a39000857bce3
10:44:43 AM:   deployId: 62f4cf6d140a39000857bce5
10:44:43 AM:   systemLogFile: 3
10:44:43 AM: ​
10:44:43 AM: ❯ Current directory
10:44:43 AM:   /opt/build/repo
10:44:43 AM: ​
10:44:43 AM: ❯ Config file
10:44:43 AM:   /opt/build/repo/netlify.toml
10:44:43 AM: ​
10:44:43 AM: ❯ Context
10:44:43 AM:   production
10:44:43 AM: ​
10:44:43 AM: ────────────────────────────────────────────────────────────────
10:44:43 AM:   1. build.command from netlify.toml                            
10:44:43 AM: ────────────────────────────────────────────────────────────────
10:44:43 AM: ​
10:44:43 AM: $ npm run build
10:44:43 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:44:43 AM: npm WARN config location in the cache, and they are managed by
10:44:43 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:44:43 AM: > @example/basics@0.0.1 build
10:44:43 AM: > astro build
10:44:44 AM: 09:44:44 AM [build] output target: static
10:44:44 AM: 09:44:44 AM [build] Collecting build info...
10:44:44 AM: 09:44:44 AM [build] Completed in 31ms.
10:44:44 AM: 09:44:44 AM [build] Building static entrypoints...
10:44:45 AM: 09:44:45 AM [build] Completed in 1.16s.
10:44:45 AM: 
10:44:45 AM:  generating static routes 
10:44:45 AM: ▶ src/pages/index.astro
10:44:46 AM:  error   parse__default is not a function
10:44:46 AM:     at file:///opt/build/repo/dist/entry.mjs?time=1660211085888:1259:20
10:44:46 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
10:44:46 AM:     at async renderToIterable (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:770:21)
10:44:46 AM:     at async renderAstroComponentInline (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:483:22)
10:44:46 AM:     at async _render (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:386:5)
10:44:46 AM:     at async AstroComponent.[Symbol.asyncIterator] (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:405:7)
10:44:46 AM:     at async renderAstroComponent (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:823:20)
10:44:46 AM:     at async renderAstroComponentInline (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:484:7)
10:44:46 AM:     at async _render (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:386:5)
10:44:46 AM:     at async AstroComponent.[Symbol.asyncIterator] (file:///opt/build/repo/dist/entry.mjs?time=1660211085888:405:7)
10:44:46 AM: ​
10:44:46 AM: ────────────────────────────────────────────────────────────────
10:44:46 AM:   "build.command" failed                                        
10:44:46 AM: ────────────────────────────────────────────────────────────────
10:44:46 AM: ​
10:44:46 AM:   Error message
10:44:46 AM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
10:44:46 AM: ​
10:44:46 AM:   Error location
10:44:46 AM:   In build.command from netlify.toml:
10:44:46 AM:   npm run build
10:44:46 AM: ​
10:44:46 AM:   Resolved config
10:44:46 AM:   build:
10:44:46 AM:     command: npm run build
10:44:46 AM:     commandOrigin: config
10:44:46 AM:     publish: /opt/build/repo/dist
10:44:46 AM:     publishOrigin: config
10:44:46 AM:   functionsDirectory: /opt/build/repo/netlify/functions
10:44:47 AM: Caching artifacts
10:44:47 AM: Started saving node modules
10:44:47 AM: Finished saving node modules
10:44:47 AM: Started saving build plugins
10:44:47 AM: Finished saving build plugins
10:44:47 AM: Started saving pip cache
10:44:47 AM: Finished saving pip cache
10:44:47 AM: Started saving emacs cask dependencies
10:44:47 AM: Finished saving emacs cask dependencies
10:44:47 AM: Started saving maven dependencies
10:44:47 AM: Finished saving maven dependencies
10:44:47 AM: Started saving boot dependencies
10:44:47 AM: Finished saving boot dependencies
10:44:47 AM: Started saving rust rustup cache
10:44:47 AM: Finished saving rust rustup cache
10:44:47 AM: Started saving go dependencies
10:44:47 AM: Finished saving go dependencies
10:44:48 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:44:48 AM: Creating deploy upload records
10:44:48 AM: Failing build: Failed to build site
10:44:48 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
10:44:48 AM: Finished processing build request in 22.123699469s

Any help is appreciated.

I solved this. In the import statement I wrapped the parse plugin in curly braces. This fixed the issue: { parse }