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

Breaks the compiler #22

Open
ChristianMayer opened this issue Dec 12, 2024 · 15 comments
Open

Breaks the compiler #22

ChristianMayer opened this issue Dec 12, 2024 · 15 comments

Comments

@ChristianMayer
Copy link

I've just installed it according to the readme:

$ npx qx pkg install qooxdoo/qxl.dialog --config-file=src/frontend/compile.json
(node:147859) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Installed qxl.dialog (qooxdoo/qxl.dialog, 5.0.0)

but trying to run the compiler it's now failing with:

$ npx qx compile --config-file=src/frontend/compile.json --watch --clean
(node:147980) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Error: Error while reading qx_packages/qooxdoo_qxl_dialog_v5_0_0/compile.js
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/cm/devel/grafweb/src/frontend/qx_packages/qooxdoo_qxl_dialog_v5_0_0/compile.js from /home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js not supported.
compile.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename compile.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/cm/devel/grafweb/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at wrapper.__P_3_11 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:35618:19)
    at wrapper.__P_3_10 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:35499:42)
    at async wrapper.run (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:35325:9)
    at async wrapper.main (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:34766:11)
@cboulanger
Copy link
Collaborator

@johnspackman Any idea why this happens?

@goldim
Copy link
Contributor

goldim commented Dec 12, 2024

@ChristianMayer I've also use qxl dialog in my app but didn't get the error. Maybe something wrong happens on this week. Could you add more info about OS, nodejs, framework (versions).

@ChristianMayer
Copy link
Author

It's not the latest as I'm in the middle of creating new features, so I don't want the uncertainty of new versions at the same time.
OS is Kubuntu 24.04.1 LTS. The versions are:

$ node --version
v21.3.0
$ npx --version
10.2.4
$ npx qx --version
7.6.2

@goldim
Copy link
Contributor

goldim commented Dec 12, 2024

Looks like it latest OS. and node is high. Maybe the problem starts with them. I use so far Ubuntu 22.04 and qx 7.7.2. I doubt it is bc qx version but just in case could you check for qx 7.2.2 to exclude qx version factor please?

@ChristianMayer
Copy link
Author

could you check for qx 7.2.2 to exclude qx version factor please?

When you tell me how to do it, I'd be happy to.

@goldim
Copy link
Contributor

goldim commented Dec 13, 2024

Just install newest version via npm install @qooxdoo/framework or npm install @qooxdoo/[email protected] . Or is it impossible?

@ChristianMayer
Copy link
Author

Ah, 7.7.2 :)
Yes, that's possible but it'll take a few days as I must finish my current work at adding features to my code. I don't want to mix it with upgrading as I wouldn't know then where to search for issues that might arise.

@goldim
Copy link
Contributor

goldim commented Dec 13, 2024

@ChristianMayer I ask you because can not install Kubuntu 24.04.

@goldim
Copy link
Contributor

goldim commented Dec 13, 2024

You may create copy of project and install there qooxdoo locally. Local qooxdoo will hide globally installed.

@ChristianMayer
Copy link
Author

Ok, now I've upgraded Qx, but the result is the same:

$ npx qx --version
7.7.2
$ npx qx pkg install qooxdoo/qxl.dialog --config-file=src/frontend/compile.json
Installed qxl.dialog (qooxdoo/qxl.dialog, 5.0.0)
$ npx qx compile --config-file=src/frontend/compile.json --watch --clean
Error: Error: Error while reading qx_packages/qooxdoo_qxl_dialog_v5_0_0/compile.js
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/cm/devel/grafweb/src/frontend/qx_packages/qooxdoo_qxl_dialog_v5_0_0/compile.js from /home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js not supported.
compile.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename compile.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/cm/devel/grafweb/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at wrapper.__P_3_11 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31985:19)
    at wrapper.__P_3_10 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31887:42)
    at async wrapper.run (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31735:9)
    at async wrapper.main (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31253:11)

@ChristianMayer
Copy link
Author

Now updating node to the latest LTS:

$ nvm install v22.12.0
$ nvm use v22.12.0
Now using node v22.12.0 (npm v10.9.0)
$ npx qx compile --config-file=src/frontend/compile.json --watch --clean
Error: Error: Error while reading qx_packages/qooxdoo_qxl_dialog_v5_0_0/compile.js
ReferenceError: module is not defined
    at wrapper.__P_3_11 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31985:19)
    at wrapper.__P_3_10 (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31887:42)
    at async wrapper.run (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31735:9)
    at async wrapper.main (/home/cm/devel/grafweb/node_modules/@qooxdoo/framework/lib/compiler/index.js:31253:11)

@hkollmann
Copy link
Member

node version 23.3.0
qx version 7.7.2

qx create test
cd test
qx pkg install qooxdoo/qxl.dialog
qx compile

is working without any problems

@goldim
Copy link
Contributor

goldim commented Dec 15, 2024

Tomorrow I will check on my ubuntu laptop. Maybe the problem is in --config-file arg.

@goldim
Copy link
Contributor

goldim commented Dec 16, 2024

@ChristianMayer node v21.1.7 . Ubuntu 22.04. qx 7.7.2. Works fine but without arg --config-file. I also got some errors using --config-file but they are different and fixed them on the fly. Have you always used this argument? Try without it - running compilation from your project folder. If it is fine then some problem with you environment probably or with this argument. Also would be nice if you tell more information about your project structure, location and show compile.json file.

@cboulanger
Copy link
Collaborator

cboulanger commented Dec 17, 2024

Yes this would help! I might find some time over the holidays to create a fix that would work if I can reproduce the issue with some code - like a minimal qooxdoo project based on the hello world, making an API call to your backend which fails and using a similar config structure as your original project.

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

4 participants