Situation
Testing demo.
Expected
Console output about missed or cached tiles.
Experienced
Firefox 130.0 (64-bit) (macOS)
Uncaught SyntaxError: import declarations may only appear at top level of a module
L.TileLayer.PouchDBCached.js:3:1
Safari Version 17.6 (18618.3.11.11.7, 18618)
SyntaxError: Unexpected identifier 'PouchDB'. import call expects one or two arguments.
L.TileLayer.PouchDBCached.js:3
Chrome Version 128.0.6613.138 (Official Build) (x86_64)
Uncaught SyntaxError: Cannot use import statement outside a module
L.TileLayer.PouchDBCached.js:3
Attempted Workarounds
script type of TileLayer.PouchDBCached.js
Changed in a local copy:
<script src="L.TileLayer.PouchDBCached.js"></script>
to
<script type="module" src="L.TileLayer.PouchDBCached.js"></script>
Error is now:
Firefox
Uncaught TypeError: The specifier “pouchdb” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.
Safari
SyntaxError: Unexpected identifier 'PouchDB'. import call expects one or two arguments.
Chrome
Uncaught SyntaxError: Cannot use import statement outside a module (at L.TileLayer.PouchDBCached.js:3:1)
script type of TileLayer.PouchDBCached.js and pouchdb.js
Same as above.
Use tested versions
Replaced demo versions with:
<script src="https://unpkg.com/leaflet@^1.0.0/dist/leaflet-src.js"></script>
<script src="https://unpkg.com/pouchdb@^5.2.0/dist/pouchdb.js"></script>
<script src="https://unpkg.com/leaflet.tilelayer.pouchdbcached@latest/L.TileLayer.PouchDBCached.js"></script>
This works.
Replaced leaflet 1.0 with leaflet 1.4. Still works.
Replaced leaflet 1.0 with leaflet 1.9.4 (latest). Still works.
Replaced L.TileLayer.PouchDBCaches.js with new version from GitHub - fails.
Replaced pouchdb.js from demo (which actually is 5.4.5) with latest 9.0.0 - fails.
Maybe we need information which pouchdb.js version works with the latest version of L.TileLayer.PouchDBCaches.js ?
Situation
Testing demo.
Expected
Console output about missed or cached tiles.
Experienced
Firefox 130.0 (64-bit) (macOS)
Safari Version 17.6 (18618.3.11.11.7, 18618)
Chrome Version 128.0.6613.138 (Official Build) (x86_64)
Attempted Workarounds
script type of TileLayer.PouchDBCached.js
Changed in a local copy:
to
Error is now:
Firefox
Safari
Chrome
script type of TileLayer.PouchDBCached.js and pouchdb.js
Same as above.
Use tested versions
Replaced demo versions with:
This works.
Replaced leaflet 1.0 with leaflet 1.4. Still works.
Replaced leaflet 1.0 with leaflet 1.9.4 (latest). Still works.
Replaced L.TileLayer.PouchDBCaches.js with new version from GitHub - fails.
Replaced pouchdb.js from demo (which actually is 5.4.5) with latest 9.0.0 - fails.
Maybe we need information which pouchdb.js version works with the latest version of L.TileLayer.PouchDBCaches.js ?