Skip to content

🐛 BUG: attribute namespace "on" throws entire project #1237

@jonathantneal

Description

@jonathantneal

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

When using the attribute namespace on, the entire project throws.

Usage:

<button on:click>
  click me
</button>

Error:

node_modules/astro/dist/compiler/codegen/index.js:665
            throw new Error("Unexpected (enter) node type: " + node.type);
                  ^

Error: Unexpected (enter) node type: EventHandler
    at Object.enter (node_modules/astro/dist/compiler/codegen/index.js:665:19)
    at AsyncWalker.visit (node_modules/astro/node_modules/estree-walker/src/async.js:49:22)
    at AsyncWalker.visit (node_modules/astro/node_modules/estree-walker/src/async.js:79:25)
    at async AsyncWalker.visit (node_modules/astro/node_modules/estree-walker/src/async.js:79:14)
    at async AsyncWalker.visit (node_modules/astro/node_modules/estree-walker/src/async.js:79:14)
    at async AsyncWalker.visit (node_modules/astro/node_modules/estree-walker/src/async.js:79:14)
    at async asyncWalk (node_modules/astro/node_modules/estree-walker/src/index.js:34:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to Reproduce

  1. git clone git@github.com:jonathantneal/astro-namespace-issue.git and cd astro-namespace-issue
  2. yarn
  3. yarn start
  4. Visit the page (e.g. http://localhost:3000/)
  5. Error! Unexpected (enter) node type: EventHandler

Link to Minimal Reproducible Example (Optional)

https://github.com/jonathantneal/astro-namespace-issue

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