Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with clean build #1

Open
Granadagames opened this issue Apr 18, 2024 · 1 comment
Open

Error with clean build #1

Granadagames opened this issue Apr 18, 2024 · 1 comment

Comments

@Granadagames
Copy link

Granadagames commented Apr 18, 2024

To reproduce, clone the repo and run pnpm run build.

PS J:\box\template-rollup-ts> pnpm run build

> [email protected] build J:\box\template-rollup-ts
> rollup --config rollup/rollup.config.prod.mjs


src/main.ts → ./dist/bundle.js...
Building for production...
---------------------------------------------------------
❤️❤️❤️ Tell us about your game! - [email protected] ❤️❤️❤️
---------------------------------------------------------
(!) "this" has been rewritten to "undefined"
https://rollupjs.org/troubleshooting/#error-this-is-undefined
node_modules/.pnpm/[email protected]/node_modules/phaser/dist/phaser.js
 8:   else
 9:     root["Phaser"] = factory();
10: })(this, () => {
       ^
11: return /******/ (() => { // webpackBootstrap
12: /******/    var __webpack_modules__ = ({
[!] RollupError: src/scenes/Boot.ts (1:9): "Scene" is not exported by "node_modules/.pnpm/[email protected]/node_modules/phaser/dist/phaser.js", imported by "src/scenes/Boot.ts".
https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module
src/scenes/Boot.ts (1:9)
1: import { Scene } from 'phaser';
            ^
2: export class Boot extends Scene {
3:     constructor() {
    at getRollupError (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\parseAst.js:282:41)
    at Object.error (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\parseAst.js:278:42)
    at Module.error (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:15122:28)
    at Module.traceVariable (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:15570:29)
    at ModuleScope.findVariable (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:13258:39)
    at ChildScope.findVariable (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:7480:38)
    at Identifier.bind (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:8752:40)
    at ClassDeclaration.bind (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:6208:23)
    at ExportNamedDeclaration.bind (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:11220:27)
    at Program.bind (J:\box\template-rollup-ts\node_modules\.pnpm\[email protected]\node_modules\rollup\dist\shared\rollup.js:6204:28)


 ELIFECYCLE  Command failed with exit code 1.
@noahpodgurski
Copy link

I also struggled with this, you can try instead

// import Phaser from 'phaser';

export class Boot extends Phaser.Scene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants