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 running performance benchmark #2122

Closed
ZeLonewolf opened this issue Jan 31, 2023 · 3 comments
Closed

Error running performance benchmark #2122

ZeLonewolf opened this issue Jan 31, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers PR is more than welcomed Extra attention is needed

Comments

@ZeLonewolf
Copy link
Contributor

ZeLonewolf commented Jan 31, 2023

The performance benchmark hangs with errors.

maplibre-gl-js version: Current main revision

Steps to Trigger Behavior

  1. At the console, run MAPLIBRE_STYLES=https://zelonewolf.github.io/openstreetmap-americana/style.json npm run start-bench
  2. Observe output in the console
  3. Go to http://localhost:9966/test/bench/styles/index.html -- nothing happens

Expected Behavior

Performance benchmark reports no errors and user can run performance benchmarks in a web browser as specified in the docs.

Actual Behavior

Performance benchmark hangs with errors:

> [email protected] start-bench
> run-p watch-css watch-benchmarks start-server


> [email protected] watch-benchmarks
> rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts --watch


> [email protected] watch-css
> postcss --watch -o dist/maplibre-gl.css src/css/maplibre-gl.css


> [email protected] start-server
> st --no-cache -H 0.0.0.0 --port 9966 .

listening at http://0.0.0.0:9966
[!] RollupError: Rollup transpiled your configuration to an  ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.

Original error: require is not defined in ES module scope, you can use import instead
https://rollupjs.org/guide/en/#--bundleconfigascjs
ReferenceError: require is not defined in ES module scope, you can use import instead
    at file:///home/brian/git/maplibre-gl-js/test/bench/rollup.config-1675192292098.mjs:75:29
    at Array.map (<anonymous>)
    at file:///home/brian/git/maplibre-gl-js/test/bench/rollup.config-1675192292098.mjs:75:10
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at loadConfigFromWrittenFile (/home/brian/git/maplibre-gl-js/node_modules/rollup/dist/shared/loadConfigFile.js:487:17)
    at getConfigFileExport (/home/brian/git/maplibre-gl-js/node_modules/rollup/dist/shared/loadConfigFile.js:410:20)
    at Object.loadConfigFile (/home/brian/git/maplibre-gl-js/node_modules/rollup/dist/shared/loadConfigFile.js:391:59)
@HarelM
Copy link
Collaborator

HarelM commented Feb 1, 2023

Yup, this is what happens when things don't run as part of a ci.
Feel free to open a PR to fix this. This looks a small issue, I'll label it good first issue.

@HarelM HarelM added bug Something isn't working good first issue Good for newcomers PR is more than welcomed Extra attention is needed labels Feb 1, 2023
@zhangyiatmicrosoft
Copy link
Contributor

It will be very helpful to create a bench-sanity test which will execute one pass and really fast to make sure it always work, and add to CI.

@HarelM
Copy link
Collaborator

HarelM commented Feb 2, 2023

There is an issue about it basically: #982 it's harder than it looks...

smellman added a commit to smellman/maplibre-gl-js-1 that referenced this issue May 10, 2024
smellman added a commit to smellman/maplibre-gl-js-1 that referenced this issue May 10, 2024
smellman added a commit to smellman/maplibre-gl-js-1 that referenced this issue May 10, 2024
smellman added a commit to smellman/maplibre-gl-js-1 that referenced this issue May 10, 2024
@HarelM HarelM closed this as completed in fbf7295 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants