Closed carocad closed 6 years ago
It seems that this behavior is intended by the metro bundler: https://facebook.github.io/metro/docs/en/getting-started.html#url-and-bundle-request
It seems that this behavior is intended by the metro bundler
Does it mean your fix is not going into metro?
btw, here is a patch that can be applied this way:
$ patch node_modules/metro/src/Server/index.js metro.patch
--- index.js 2018-06-27 00:36:07.226552711 +0200
+++ node_modules/metro/src/Server/index.js 2018-06-27 00:37:03.010362163 +0200
@@ -775,7 +775,7 @@
// Backwards compatibility. Options used to be as added as '.' to the
// entry module name. We can safely remove these options.
- const entryFile =
+ let entryFile =
pathname.
replace(/^\//, '').
split('.').
@@ -795,7 +795,8 @@
}
return true;
}).
- join('.') + '.js';
+ join('.');
+ entryFile = entryFile.endsWith('.js') ? entryFile : entryFile + '.js';
// try to get the platform from the url
const platform =
@@ -906,4 +907,4 @@
}
}
-module.exports = Server;
\ No newline at end of file
+module.exports = Server;
Moreover applying the patch works like charm on Linux and Mac. No more errors in terminal. On Mac I get that db/unique
error in Chrome console which I think is not related to this issue.
btw, here is a patch that can be applied this way:
oh nice. I will add it to the build process so that it goes smoother
Does it mean your fix is not going into metro?
After some further discussions in the #cljsrn channel it seems that this error does not consistently happens for the latest version of the build scripts. Unfortunately we are not there yet so I dont know if this is an isolated problem or a general one. I am waiting for some feedback to see if a PR makes sense.
@carocad is this still a problm for us?
@mehdisadeghi to be honest I dont know
since I use my patched version of the packager I never looked back and see if the problem was still there.
Apparently nobody else is having this problem since there doesnt seem to be any reports in the re-natal repo.
I would leave this open for the time being.
I am planning to migrate the project to node.js target which (AFAIK) doesnt have this problem. I think then we can close this properly :)
@mehdisadeghi this is the problem that you have reported to me several times
It seems that this is a general problem due to the sourcemaps in Clojurescript. After some discussions in the #cljsrn channel in slack I got a patch that fixes it. I will talk with the
metro
packager developers to see if we can get it upstream.For the time being, we would have to do this manually. I guess a git patch would be better but no time right now :)
This is the error that we get in the terminal
It comes from this file:
/Users/Camilo/Proyectos/hive/node_modules/metro/src/Server/index.js
in the_getOptionsFromUrl
function.It seems that they assumed that the files would always have custom extensions like
main.bundle
andmain.delta
. However, the Closure compiler provides the complete filename directly, without any need for further processing which causes the error as an extra.js
is appended anyway.The solution is quite simple. If the entryFile endswith
.js
then dont append anything, otherwise append a.js
. The code changes for that are these: