Skip to content

astro@next - terser issue #335

@FredKSchott

Description

@FredKSchott

Describe the bug

The next version of Astro will be powered by Vite! This is a departure from our current Snowpack build engine.

I'm trying to get this running on Stackblitz so that I can include a link in our preview announcement blog post, but I'm seeing an odd terser bug. We don't run terser as far as I know, so I'm assuming that this is something happening in Stackblitz? "Error: Build failed with 1 error:" doesn't seem to be anywhere in our codebase (see below for full error).

Link to the blitz that caused the error

https://stackblitz.com/github/snowpackjs/astro/tree/next/examples/minimal

Steps to reproduce

  1. Go to https://stackblitz.com/github/snowpackjs/astro/tree/next/examples/minimal
  2. run npm install astro@next--compiler To install the new compiler
  3. run npm start to start the Astro dev server
  4. run npm run build to start the Astro build process

Expected behavior

Both commands run locally. When you run npm start, Astro shows our "Welcome to Astro" minimal template page.

Actual behavior

$ astro dev
 > node_modules/terser/dist/bundle.min.js:27827:39: error: Could not resolve "acorn" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
    27827 │                         return require("acorn").parse(files[name], {
          ╵                                        ~~~~~~~

Error: Build failed with 1 error:
node_modules/terser/dist/bundle.min.js:27827:39: error: Could not resolve "acorn" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)

Screenshots

No response

Platform

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions