Thursday, 13 April 2017

Error importing Leaflet and Leaflet-Providers when run in node

I am running unit tests on a leaflet app with tape + babel-register using es6 modules and I'm getting

ReferenceError: L is not defined

in leaflet-providers.js when importing leaflet and leaflet-providers in the module I am testing.

testfile.js

import L from 'leaflet';
import { provider } from 'leaflet-providers';

I'm not entirely sure my syntax is correct for importing a leaflet plugin using es6 modules, but it's working for me in the browser, and only not working when I run unit tests through node.

Why is leaflet-providers unable to find L when run through node?



via Chris Hull

No comments:

Post a Comment