Skip to content

env(.filename) doesn't always exist #50

@NullVoxPopuli

Description

@NullVoxPopuli

this is maybe user-error, but if you specify the template transform like this:

    [
      "babel-plugin-ember-template-compilation",
      {
        "targetFormat": "hbs",
        "transforms": [
          ["glimmer-scoped-css/ast-transform"],
        ]
      }
    ],

you get an error:

[!] (plugin babel) TypeError: <repo>/src/index.ts: Cannot read properties of undefined (reading 'filename')

src/index.ts
    at <.pnpm>/glimmer-scoped-css@0.8.1/node_modules/glimmer-scoped-css/src/ast-transform.ts:30:11

The plugin must be specified like this:

    [
      "babel-plugin-ember-template-compilation",
      {
        "targetFormat": "hbs",
        "transforms": [
          ["glimmer-scoped-css/ast-transform", {}],
        ]
      }
    ],

or, as documented:

    [
      "babel-plugin-ember-template-compilation",
      {
        "targetFormat": "hbs",
        "transforms": [
          "glimmer-scoped-css/ast-transform",
        ]
      }
    ],

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