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] Could not resolve "fflate" #455

Closed
renefournier opened this issue Sep 18, 2024 · 2 comments
Closed

✘ [ERROR] Could not resolve "fflate" #455

renefournier opened this issue Sep 18, 2024 · 2 comments

Comments

@renefournier
Copy link

Trying to npm run build in /serverless/cloudflare and I get these warnings & errors:

rm -rf node_modules && npm update && npm run build
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

added 90 packages, and audited 91 packages in 3s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> [email protected] build
> wrangler deploy --dry-run --outdir dist


 ⛅️ wrangler 3.78.4
-------------------

✘ [ERROR] Could not resolve "fflate"

    ../../js/index.ts:1:31:
      1 │ import { decompressSync } from "fflate";
        ╵                                ~~~~~~~~

  You can mark the path "fflate" as external to exclude it from the bundle, which will remove this error.


✘ [ERROR] Could not resolve "fflate"

    ../../js/v2.ts:1:31:
      1 │ import { decompressSync } from "fflate";
        ╵                                ~~~~~~~~

  You can mark the path "fflate" as external to exclude it from the bundle, which will remove this error.



✘ [ERROR] Could not resolve "fflate"

    ../../js/index.ts:1:31:
      1 │ import { decompressSync } from "fflate";
        ╵                                ~~~~~~~~

  You can mark the path "fflate" as external to exclude it from the bundle, which will remove this error.


✘ [ERROR] Could not resolve "fflate"

    ../../js/v2.ts:1:31:
      1 │ import { decompressSync } from "fflate";
        ╵                                ~~~~~~~~

  You can mark the path "fflate" as external to exclude it from the bundle, which will remove this error.


✘ [ERROR] Build failed with 2 errors:

  ../../js/index.ts:1:31: ERROR: Could not resolve "fflate"
  ../../js/v2.ts:1:31: ERROR: Could not resolve "fflate"


🪵  Logs were written to "/Users/rene/Library/Preferences/.wrangler/logs/wrangler-2024-09-18_17-31-00_388.log"

Log output:

--- 2024-09-18T17:31:00.456Z debug
🪵  Writing logs to "/Users/rene/Library/Preferences/.wrangler/logs/wrangler-2024-09-18_17-31-00_388.log"
---

--- 2024-09-18T17:31:00.456Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:581:18)
    at Object.readFileSync (node:fs:457:35)
    at tryLoadDotEnv (/Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:158087:72)
    at loadDotEnv (/Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:158096:12)
    at /Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:213533:20
    at /Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:179284:16
    at maybeAsyncResult (/Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:177505:44)
    at /Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:179283:14
    at /Users/rene/Desktop/PMTiles/serverless/cloudflare/node_modules/wrangler/wrangler-dist/cli.js:177492:22
    at Array.reduce (<anonymous>) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '.env'
}
---

--- 2024-09-18T17:31:00.461Z log

 ⛅️ wrangler 3.78.4
�[38;2;255;136;0m-------------------�[39m

---

--- 2024-09-18T17:31:00.462Z debug
No experimental flag store instantiated
---

--- 2024-09-18T17:31:00.462Z debug
Attempted to use flag "JSON_CONFIG_FILE" which has not been instantiated
---

--- 2024-09-18T17:31:00.498Z log

---

--- 2024-09-18T17:31:00.499Z error
�[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mBuild failed with 2 errors:�[0m

  ../../js/index.ts:1:31: ERROR: Could not resolve "fflate"
  ../../js/v2.ts:1:31: ERROR: Could not resolve "fflate"


---
@bdon
Copy link
Member

bdon commented Sep 19, 2024

You need to do npm install & npm run build inside PMTiles/js first. A bit awkward right now.

bdon added a commit that referenced this issue Jan 13, 2025
This is clearer to developers than relying on the local code being built.
bdon added a commit that referenced this issue Jan 14, 2025
bdon added a commit that referenced this issue Jan 14, 2025
This is clearer to developers than relying on the local code being built.
bdon added a commit that referenced this issue Jan 14, 2025
bdon added a commit that referenced this issue Jan 14, 2025
* Make aws/cloudflare depend on pmtiles from npm [#455]

This is clearer to developers than relying on the local code being built.

* update check_examples.py
* bump openlayers to v2 with upgrade of pmtiles to v4 [#455]
* update to 4.2.1
@bdon
Copy link
Member

bdon commented Jan 14, 2025

I have updated the instructions/package.json so the npm install in js is no longer necessary:

https://github.com/protomaps/docs/pull/94/files

@bdon bdon closed this as completed Jan 14, 2025
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