Closed kyen99 closed 7 years ago
@kyen99 I don't see a Dockerfile or stated support for Docker in this repo. I'm sure David would appreciate less issues and more PRs.
@jhabdas, agreed I should have included a link to a fork that contains the Dockerfile (also included below). Regarding David appreciating more PRs than issues, I don't see how I can submit a PR until I can resolve the issue. Are you suggesting that I should have submitted a PR with the Dockerfile and put my issue into the PR notes? I will absolutely submit a proper PR when I can resolve this.
Here is a fork that contains the Dockerfile: https://github.com/purple-squirrel-io/react-redux-starter-kit
I build a container using:
docker build . -t rsk
then run the test using:
docker run -it rsk npm test
The Dockerfile is also here (which is all that is needed):
FROM node:4
EXPOSE 3000
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
CMD [ "npm", "run", "start:prod" ]
After more debugging on this issue, I realize that it's not that something different is done in the docker container vs my mac, but that webpack doesn't show any output unless there is an error. I also don't think Docker has anything to do with this. I think there is just an issue running npm test on Debian 8 (jessie). Maybe it has something to do with an npm package. I'll keep trying to track down the issue.
I see the exact same error happening on Ubuntu with a vanilla checkout of the 3.0.0 alpha 2. It looks like a problem with PhantomJS?
The more I look at the errors, the more I think it's an issue with babel-runtime or a babel plugin. Even if I resolve the stage-2 preset error I still can't resolve...
ERROR in TypeError: $export is not a function
I run into the same problem. What helped was:
diff --git a/src/frontend/build/karma.conf.js b/src/frontend/build/karma.conf.js
index 4602dc7..c692b5c 100644
--- a/src/frontend/build/karma.conf.js
+++ b/src/frontend/build/karma.conf.js
@@ -62,6 +62,7 @@ if (config.globals.__COVERAGE__) {
karmaConfig.webpack.module.preLoaders = [{
test : /\.(js|jsx)$/,
include : new RegExp(config.dir_client),
+ exclude : /node_modules/,
loader : 'babel',
query : Object.assign({}, config.compiler_babel, {
plugins : (config.compiler_babel.plugins || []).concat('istanbul')
Yep, that fixed the issue. Thanks for taking the time to post the solution. I'm going to submit this as a PR.
Looks like this has been merged; thanks again!
With a new clone of react-redux-starter-kit (c3abb2), npm test fails when run in a docker container with the official node image (tried 4.6, 6.6 and 6.7). Running npm test on the same source, locally on my mac, works, though (with node 6.7). When run in the docker container it seems to do some bundling with webpack. When run locally on my mac it does not, even with the same NODE_ENV=test in the environment.
Besides the error in the docker container, I can't understand why the npm test runs differently in the container vs outside the container. The only obvious difference I can see is linux vs mac.
Also, running npm test:dev does work in the docker container. It doesn't do any of the webpack stuff, same as it behaves on my mac.
Here is the output when run in the docker container...
... [lots of lines with no errors] ...