Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: @babel/polyfill not found in Docker container #831

Merged
merged 1 commit into from May 18, 2023

Conversation

emcniece
Copy link
Contributor

Applies the fix from #803 to the Docker entrypoint script so that the Docker images can run properly.

This is not fully functional yet: when accessing the app from the browser an error displays and the container logs out:

2023-05-17T03:29:37.666Z - info init Loading configuration from "/root/.cncrc"
(node:1) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
2023-05-17T03:29:37.725Z - info init Starting the server at http://172.17.0.2:8000
Error: Failed to lookup view "index.hbs" in views directories "/opt/cncjs/app" or "/opt/cncjs/server/views"
    at Function.render (/opt/cncjs/node_modules/express/lib/application.js:580:17)
    at ServerResponse.render (/opt/cncjs/node_modules/express/lib/response.js:1008:7)
    at /opt/cncjs/server/app.js:66:9
    at Layer.handle [as handle_request] (/opt/cncjs/node_modules/express/lib/router/layer.js:95:5)
    at next (/opt/cncjs/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/opt/cncjs/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/opt/cncjs/node_modules/express/lib/router/layer.js:95:5)
    at /opt/cncjs/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/opt/cncjs/node_modules/express/lib/router/index.js:335:12)
    at next (/opt/cncjs/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle [as handle_request] (/opt/cncjs/node_modules/express/lib/router/layer.js:91:12)
    at trim_prefix (/opt/cncjs/node_modules/express/lib/router/index.js:317:13)
    at /opt/cncjs/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/opt/cncjs/node_modules/express/lib/router/index.js:335:12)

To remedy this, index.hbs is copied into the server directory. Now when accessing the app in browser a loading icon appears, but nothing happens. There are no terminal or JS console logs.

I'm not sure if this is the correct approach for fixing the HTML templating, need to investigate. @cheton any suggestions? 馃檹

Resolves #829 and #826.

Dockerfile Outdated Show resolved Hide resolved
entrypoint Show resolved Hide resolved
@cheton cheton self-requested a review May 18, 2023 04:31
@emcniece emcniece merged commit e7d0154 into cncjs:master May 18, 2023
3 checks passed
@emcniece emcniece deleted the fix/docker-babel-polyfill branch May 18, 2023 04:57
@emcniece
Copy link
Contributor Author

Thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest Docker image throws: Error: Cannot find module '@babel/polyfill'
2 participants