[Bug] Tests fail due to URL parsing
Description
Seeing an issue where the tests fail due to an inability to parse a URL:
# uncaughtException
not ok 6210 TypeError: Failed to parse URL from ./test/data/mvt-with-hole/3/1/3.mvt
---
operator: error
expected: |-
undefined
actual: |-
{ [TypeError: Failed to parse URL from ./test/data/mvt-with-hole/3/1/3.mvt] [cause]: { [TypeError [ERR_INVALID_URL]: Invalid URL] input: './test/data/mvt-with-hole/3/1/3.mvt', code: 'ERR_INVALID_URL' } }
at: Test.die (/home/anthony/repos/deck.gl/node_modules/tape-catch/index.js:56:10)
stack: |-
TypeError: Failed to parse URL from ./test/data/mvt-with-hole/3/1/3.mvt
at Object.fetch (node:internal/deps/undici/undici:11457:11)
...
I am developing using WSL and node version v18.16.1
Flavors
- [ ] Script tag
- [ ] React
- [ ] Python/Jupyter notebook
- [ ] MapboxOverlay
- [ ] GoogleMapsOverlay
- [ ] CartoLayer
- [ ] ArcGIS
Expected Behavior
Expect the tests to succeed on master.
Steps to Reproduce
Run test on a master build in WSL
Environment
- Framework version: master
- Browser: NA
- OS: Windows, WSL2
Logs
No response
@4nthonylin Just checking that are not trying to load local files into the browser? That is not supported (unless you start your browser with one -unsafe... flags.
If that is the case, it would of course be better to offer a more clear error message.
The tests on CI currently run in node v16.
@ibgreen The node tests loads data from the local file system. Node v18 natively supports the global function fetch, so data fetching is no longer routed through @loaders.gl/polyfill. I can see that loaders.gl uses node v16 for testing as well.
Using node v16 works! Should we enforce with engine to use node 16 then?
Getting a different error now with yarn test fast
1..6227
# tests 6227
# pass 6227
# ok
Segmentation fault
I ran into this while running yarn test on MacOS and node 18 today while on the 8.9-release branch. I didn't notice this in #8222 since most of the tests are disabled on master for v9 development right now.