Skip to content

import.meta not supported inside wxt.config.ts file #934

Description

@minht11

Describe the bug

Try using import.meta.dirname inside wxt.config.ts file.

✖ Command failed after 96 ms                                                                                            5:14:37 PM

 ERROR  Cannot use 'import.meta' outside a module                                                                        5:14:37 PM

  import.meta.dirname;
  ^^^^
  
  SyntaxError: Cannot use 'import.meta' outside a module
  at new Script (node:vm:99:7)
  at createScript (node:vm:255:10)
  at Object.runInThisContext (node:vm:303:10)

Reproduction

Use import.meta.dirname inside wxt.config.ts file.

Steps to reproduce

No response

System Info

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1
    Memory: 77.20 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.proto/shims/node
    Yarn: 1.22.22 - ~/.proto/shims/yarn
    npm: 10.2.4 - ~/.proto/shims/npm
    pnpm: 9.6.0 - ~/.proto/shims/pnpm
  Browsers:
    Brave Browser: 126.1.67.123
    Chrome: 127.0.6533.120
    Chrome Canary: 130.0.6669.0
    Edge: 127.0.2651.105
    Safari: 17.6

Used Package Manager

npm

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions