source like
import { GeoJSON as LeafletGeoJSON, type LatLng, type Layer } from 'leaflet';
is turned into (es)
import { GeoJSON as LeafletGeoJSON, /*:: type LatLng*/, /*:: type Layer*/ } from 'leaflet';
the "2 hanging commas" causing the compiler to fail.
Opening an issue now on the plugin.
I think the solution might be to do
import { GeoJSON as LeafletGeoJSON } from 'leaflet'
import type { LatLng, Layer } from 'leaflet'
to work around the problem, I'll check it when I have some time later today and try to push a fix.
Yes, that will do (that's close to plugin example)
import type { LatLng, Layer } from 'leaflet' => /*:: import type { LatLng, Layer } from 'leaflet';*/.
But import { type LatLng, type Layer } from 'leaflet' won't as expected.
hi,
same problem in LayersControl.js
~
import React, { cloneElement, Component, Children, /:: type ChildrenArray/, /:: type Element/ } from 'react';
~
and Map.js:
~
import { latLngBounds, DomUtil, Map as LeafletMap, /:: type CRS/, /:: type Renderer/ } from 'leaflet';
~
there are always 2 hanging commas.
@PaulLeCam, I got an answer to my issue and hzoo suggests to hold off using this plugin ("pretty buggy") and place the flow syntax into a .js.flow file.
Thanks for investigating this and sorry for the trouble, it should be fixed now in v1.6.3.
It's now working using v1.6.3, thx @PaulLeCam !
npm i [email protected], 褋auses
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
@WaNgeL-SaTaR looks like an npm cache "issue". Can you retry and if it doesn't work check what npm view react-leaflet says?
Last version should be 1.6.3 (should = is for us)
Last version: '1.6.2':
$: npm view react-leaflet
{ maintainers: [ 'paul_lecam <[email protected]>' ],
keywords: [ 'react-component', 'react', 'leaflet', 'map' ],
'dist-tags': { latest: '1.6.2', next: '1.0.0-rc.3' },
author: 'Paul Le Cam <[email protected]>',
description: 'React components for Leaflet maps',
repository:
{ type: 'git',
url: 'git+https://github.com/PaulLeCam/react-leaflet.git' },
users: { markthethomas: true, smoojitter: true, uptonking: true },
bugs: { url: 'https://github.com/PaulLeCam/react-leaflet/issues' },
license: 'MIT',
versions:
[ '0.1.0-dev',
'0.2.0-dev',
'0.2.0',
'0.2.1',
'0.2.2',
'0.3.0',
'0.4.0-beta.1',
'0.4.0-rc.1',
'0.4.0',
'0.4.1',
'0.5.0',
'0.6.0',
'0.6.1',
'0.6.2',
'0.7.0',
'0.8.0-rc.1',
'0.8.0-rc.2',
'0.8.0-rc.3',
'0.8.0',
'0.8.1',
'0.9.0',
'0.10.0',
'0.10.1',
'0.10.2',
'0.11.0',
'0.11.1',
'0.11.2',
'0.11.3',
'0.11.4',
'0.11.5',
'0.11.6',
'0.11.7',
'0.12.0',
'0.12.1',
'0.12.2',
'0.12.3',
'1.0.0-beta.1',
'1.0.0-beta.2',
'1.0.0-beta.3',
'1.0.0-rc.1',
'1.0.0-rc.2',
'1.0.0-rc.3',
'1.0.0',
'1.0.1',
'1.0.2',
'1.0.3',
'1.1.0',
'1.1.1',
'1.1.2',
'1.1.3',
'1.1.4',
'1.1.5',
'1.1.6',
'1.1.7',
'1.2.0',
'1.2.1',
'1.2.2',
'1.3.0',
'1.3.1',
'1.4.0',
'1.4.1',
'1.5.0',
'1.6.0',
'1.6.1',
'1.6.2' ],
name: 'react-leaflet',
time:
{ modified: '2017-08-21T13:51:52.546Z',
created: '2014-10-18T09:36:59.076Z',
'0.1.0-dev': '2014-10-18T09:36:59.076Z',
'0.2.0-dev': '2014-11-17T07:39:12.504Z',
'0.2.0': '2014-11-30T11:15:43.628Z',
'0.2.1': '2014-12-01T21:49:44.502Z',
'0.2.2': '2015-01-14T08:00:25.415Z',
'0.3.0': '2015-01-21T20:23:57.125Z',
'0.4.0-beta.1': '2015-03-08T19:07:51.786Z',
'0.4.0-rc.1': '2015-03-11T09:17:08.291Z',
'0.4.0': '2015-03-28T14:34:42.237Z',
'0.4.1': '2015-04-06T09:20:24.407Z',
'0.5.0': '2015-05-02T16:39:22.571Z',
'0.6.0': '2015-05-18T22:31:58.273Z',
'0.6.1': '2015-05-22T07:43:11.061Z',
'0.6.2': '2015-06-14T09:43:32.901Z',
'0.7.0': '2015-09-08T20:09:41.991Z',
'0.8.0-rc.1': '2015-09-16T07:27:05.866Z',
'0.8.0-rc.2': '2015-09-22T07:31:46.335Z',
'0.8.0-rc.3': '2015-09-29T07:40:23.170Z',
'0.8.0': '2015-10-07T22:31:21.197Z',
'0.8.1': '2015-10-21T20:19:27.178Z',
'0.9.0': '2015-11-12T22:57:29.876Z',
'0.10.0': '2015-12-22T11:50:38.822Z',
'0.10.1': '2016-02-22T23:24:58.265Z',
'0.10.2': '2016-03-12T15:34:33.445Z',
'0.11.0': '2016-04-09T14:52:06.655Z',
'0.11.1': '2016-04-17T09:25:28.520Z',
'0.11.2': '2016-04-25T07:17:07.333Z',
'0.11.3': '2016-04-28T19:20:13.753Z',
'0.11.4': '2016-05-05T07:21:54.401Z',
'0.11.5': '2016-05-14T10:53:34.200Z',
'0.11.6': '2016-06-09T22:30:04.553Z',
'0.11.7': '2016-06-14T22:03:07.131Z',
'0.12.0': '2016-06-25T09:46:10.073Z',
'0.12.1': '2016-07-08T07:44:02.603Z',
'1.0.0-beta.1': '2016-07-30T09:08:18.337Z',
'1.0.0-beta.2': '2016-08-20T09:22:53.519Z',
'1.0.0-beta.3': '2016-08-26T07:20:44.252Z',
'0.12.2': '2016-09-09T06:51:09.771Z',
'0.12.3': '2016-09-21T20:32:24.501Z',
'1.0.0-rc.1': '2016-09-28T07:02:19.065Z',
'1.0.0-rc.2': '2016-10-20T20:54:33.993Z',
'1.0.0-rc.3': '2016-11-04T08:03:16.023Z',
'1.0.0': '2016-11-14T22:33:36.390Z',
'1.0.1': '2016-11-26T10:27:43.808Z',
'1.0.2': '2016-12-19T01:11:48.597Z',
'1.0.3': '2017-01-07T10:38:33.156Z',
'1.1.0': '2017-01-11T22:47:20.961Z',
'1.1.1': '2017-03-07T00:01:18.679Z',
'1.1.2': '2017-03-14T08:02:58.877Z',
'1.1.3': '2017-03-15T19:09:15.164Z',
'1.1.4': '2017-03-22T07:51:03.028Z',
'1.1.5': '2017-04-05T07:29:06.953Z',
'1.1.6': '2017-04-10T07:47:37.873Z',
'1.1.7': '2017-05-20T10:14:42.843Z',
'1.2.0': '2017-05-24T08:22:58.928Z',
'1.2.1': '2017-06-01T21:26:38.008Z',
'1.2.2': '2017-06-07T07:28:18.941Z',
'1.3.0': '2017-06-11T10:03:10.056Z',
'1.3.1': '2017-06-20T22:45:05.239Z',
'1.4.0': '2017-06-28T19:57:28.566Z',
'1.4.1': '2017-07-25T07:11:11.051Z',
'1.5.0': '2017-08-10T07:30:53.141Z',
'1.6.0': '2017-08-20T14:13:14.119Z',
'1.6.1': '2017-08-20T20:26:49.533Z',
'1.6.2': '2017-08-21T07:32:34.183Z' },
readmeFilename: 'README.md',
homepage: 'https://github.com/PaulLeCam/react-leaflet',
version: '1.6.2',
main: 'lib/index.js',
module: 'es/index.js',
'jsnext:main': 'es/index.js',
scripts:
{ clean: 'rimraf lib es dist',
'build:cjs': 'babel src --out-dir lib',
'build:es': 'cross-env BABEL_ENV=jsnext babel src --out-dir es',
'build:umd': 'cross-env BABEL_ENV=rollup NODE_ENV=development rollup -c -o dist/react-leaflet.js',
'build:umd:min': 'cross-env BABEL_ENV=rollup NODE_ENV=production rollup -c -o dist/react-leaflet.min.js',
build: 'npm run clean && npm run build:cjs && npm run build:es && npm run build:umd && npm run build:umd:min',
jest: 'cross-env BABEL_ENV=development NODE_ENV=test jest',
lint: 'eslint ./src',
flow: 'flow check',
test: 'npm run lint && npm run flow && npm run jest',
start: 'npm run test && npm run build',
prepublishOnly: 'npm run build',
examples: 'webpack-dev-server --config ./example/webpack.config.babel.js --progress' },
dependencies: { lodash: '^4.0.0', 'lodash-es': '^4.0.0', warning: '^3.0.0' },
peerDependencies:
{ leaflet: '^1.2.0',
'prop-types': '^15.5.0',
react: '^15.0.0',
'react-dom': '^15.0.0' },
devDependencies:
{ 'babel-cli': '^6.26.0',
'babel-core': '^6.26.0',
'babel-eslint': '^7.2.3',
'babel-jest': '^20.0.3',
'babel-loader': '^7.1.2',
'babel-plugin-dev-expression': '^0.2.1',
'babel-plugin-external-helpers': '^6.22.0',
'babel-plugin-lodash': '^3.2.11',
'babel-plugin-syntax-jsx': '^6.18.0',
'babel-plugin-transform-flow-comments': '^6.22.0',
'babel-plugin-transform-flow-strip-types': '^6.22.0',
'babel-plugin-transform-proto-to-assign': '^6.26.0',
'babel-plugin-transform-react-display-name': '^6.25.0',
'babel-plugin-transform-react-jsx': '^6.24.1',
'babel-preset-env': '^1.6.0',
'babel-preset-stage-1': '^6.24.1',
'cross-env': '^5.0.5',
eslint: '^4.5.0',
'eslint-config-prettier': '^2.3.0',
'eslint-plugin-flowtype': '^2.35.0',
'eslint-plugin-import': '^2.7.0',
'eslint-plugin-node': '^5.1.1',
'eslint-plugin-prettier': '^2.2.0',
'eslint-plugin-promise': '^3.5.0',
'eslint-plugin-react': '^7.2.1',
'flow-bin': '^0.53.1',
'jest-cli': '^20.0.3',
leaflet: '^1.2.0',
prettier: '^1.5.3',
'prop-types': '^15.5.0',
react: '^15.6.1',
'react-dom': '^15.6.1',
rimraf: '^2.6.1',
rollup: '^0.47.6',
'rollup-plugin-babel': '^3.0.2',
'rollup-plugin-commonjs': '^8.1.0',
'rollup-plugin-node-resolve': '^3.0.0',
'rollup-plugin-replace': '^1.1.1',
'rollup-plugin-uglify': '^2.0.1',
webpack: '^3.5.5',
'webpack-dev-server': '^2.7.1' },
jest:
{ collectCoverage: true,
transform: { '.*': '<rootDir>/node_modules/babel-jest' } },
gitHead: '8b645e81d40dd47ce3dfa4bcd1db12a6f9817072',
dist:
{ integrity: 'sha512-tDVPlJ0vMhx8+q4WEZeeN6FFoo8nPWQkQYB2s1CLfUdKwdfFMkK5hB+HK6CRmSOzODDht08oZ0qZAI5J6pLbxg==',
shasum: '8c7170b0b7e165cf9521f8c0918faeac1f3bf358',
tarball: 'http://nexus.infotech.team/repository/npm/react-leaflet/-/react-leaflet-1.6.2.tgz' },
directories: {} }
@WaNgeL-SaTaR npm web site lists the right package version so I guess the problem is on your side (and I have no idea how to fix this.)
Just now successfully install 1.6.3... I think it npm cache issue.
Most helpful comment
It's now working using v1.6.3, thx @PaulLeCam !