Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Occurrence of optional chaining operator not getting replaced  #1423

@mcmxcdev

Description

@mcmxcdev

Describe the bug
Not sure if this is a thing, but I tried deploying to Netlify and the build failed due to Unexpected token "." in __sapper__/build/server/server.js.

It turned out that this piece of code ended up in the legacy bundle untranspiled:

  <meta
    name="description"
    content="{segment ? post?.excerpt : 'Opinions and viewpoints about Programming, Lifestyle and other topics.'}"
  />

While the optional chaining operator wasn't replaced in this snippet, a couple lines above it was replaced just fine, but there it was used in variable assignments.

To Reproduce

Use code snippet above and run "export": "NODE_ENV=production sapper export --legacy"

Expected behavior
Optional chaining operator gets transpiled.

Information about your Sapper Installation:

  • Your browser: Brave Browser: 1.12.114

  • Your hosting environment: Local

  • If it is an exported (npm run export) or dynamic application: exported application

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?

Used post && post.excerpt instead, so neglectable

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