Comments (7)
I worked out a temporary work-around for users of rlayers!
I'm sharing this here as-is, without any guarantees or warranties about its correctness. USE AT YOUR OWN RISK.
Put the script below into the root of your project as an .mjs file (e.g. fix-rlayers.mjs
), and install the npm packages fs-extra
and globby
if you don't already have them.
Then run node fix-rlayers.mjs
from the root of your project.
You can optionally add a script entry to your package.json
if you want, maybe even the postinstall
script, which is run automatically after you run npm install
; this should help the fix be applied even in a CI environment.
fix-rlayers.mjs
:
import fs from "fs-extra";
import { globbySync as globby } from "globby";
process.chdir("node_modules/rlayers");
fs.copySync("src", ".", { recursive: true });
const allMaps = globby("**/*.map");
for (const mapPath of allMaps) {
const m = fs.readJSONSync(mapPath);
m["sourceRoot"] = "";
m["sources"] = m["sources"].map((s) => {
const parts = s.split("/");
return parts[parts.length - 1];
});
fs.writeJSONSync(mapPath, m);
}
from rlayers.
Update: from trying around a bit myself, the quickest fix is changing tsc's sourceRoot
and outDir
to its default (which is right next to each .ts file), and then just packaging the whole workspace.
tsconfig.json change:
diff --git a/tsconfig.json b/tsconfig.json
index 0250660..c782d8c 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,18 +1,16 @@
{
"compilerOptions": {
"sourceMap": true,
- "sourceRoot": "src",
"noImplicitAny": false,
"module": "commonjs",
"target": "es5",
"lib": [
"esnext",
"dom",
"dom.iterable"
],
- "outDir": "./dist",
"declaration": true,
"declarationMap": true,
"removeComments": true,
"allowSyntheticDefaultImports": true,
"jsx": "react",
This is annoying during development because it clutters your workspace, so some workarounds are probably desirable.
from rlayers.
WARNING in ./node_modules/rlayers/style/RText.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'C:\Users\User\Documents\sgisdevelopment\sgis\client\node_modules\rlayers\style\src\style\RText.tsx' file: Error: ENOENT: no such file or directory, open 'C:\Users\user\Documents\sgisdevelopment\sgis\client\node_modules\rlayers\style\src\style\RText.tsx'
Still getting error after changing tsconfig.json to "inlineSources": true,
from rlayers.
You seem to have some 3rd party source map loader installed - it is this loader that generates the message.
I will probably end up completely removing the source maps, as there seem to be various extensions that can read them and given that they are used only for debugging, they are probably of no interest to most of the users.
from rlayers.
You seem to have some 3rd party source map loader installed - it is this loader that generates the message.
I will probably end up completely removing the source maps, as there seem to be various extensions that can read them and given that they are used only for debugging, they are probably of no interest to most of the users.
Fixed it using @lehnerpat fix .mjs file.
Keep up the good work!
from rlayers.
Can you please test if your tools work with this source map in control/RFullScreen.js.map
{"version":3,"file":"RFullScreen.js","sourceRoot":"rlayers/src/","sources":["control/RFullScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sCAAsC;AAItC,gEAAsE;AAoBtE;IAAyC,+BAAqD;IAG1F,qBAAY,KAAiC,EAAE,OAAoC;QAAnF,YACI,kBAAM,KAAK,EAAE,OAAO,CAAC,SAExB;QADG,KAAI,CAAC,EAAE,GAAG,IAAI,oBAAU,CAAC,KAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;;IACpD,CAAC;IAED,+BAAS,GAAT,UAAU,KAAuB;QAC7B,6BACO,iBAAM,SAAS,YAAC,KAAK,CAAC,KACzB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,IAC5B;IACN,CAAC;IACL,kBAAC;AAAD,CAAC,AAlBD,CAAyC,sBAAY,GAkBpD"}
from rlayers.
Should be fixed in 1.3.2
from rlayers.
Related Issues (20)
- is it possible to do layer pixel manipulation? HOT 1
- Using non-default projection with OSM and Next.js HOT 3
- RLayerWMTS fetches the wmts file twice HOT 4
- Popup fΓΆr vector tile layers HOT 1
- RStadiaLayer is not being exported HOT 2
- Is it possible to load tiles using the setTileLoadFunction ? HOT 2
- Unable to use `RPopup` with `RLayerCluster` HOT 10
- Snap doesn't work when use Rmodify HOT 4
- Can't set default rotation in the RView HOT 1
- map is undefined HOT 2
- Improvements for RLayerTileWMSProps HOT 1
- onDrawStart and onDrawEnd not working for RModify interaction HOT 4
- Calling an event only once HOT 3
- Setting tabindex HOT 2
- improve tile layer props HOT 1
- Google Maps Integration HOT 1
- RLayerTileWMS refresh unexpectly HOT 9
- Event Propagation in onPointerDrag HOT 3
- RDragZoom does not extend RDragBox and onChange appears not to work
- RLayerCluster url loading with react suspense
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rlayers.