Recently, I got unexpected problem when deploying my Ruby on Rails app to Heroku:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in node_modules/@babel/helper-compilation-targets/package.json
To be honest, I do not have any idea because I did not touch any javascript code at all, does anyone encounter this error and resolved it?
Here is the full logs: https://gist.github.com/johnvmo/b3340f541cf32cb0c15ecbffc1aca6f9
I am very appreciated if someone can help.
Ran into the same error and found this:
Solution
This is a regression in Node.js. If you hit this issue from search engines, please choose one of the following solutions
update @babel deps to v7.8.7
use Node < 13.9
wait until nodejs/node#32107 is fixed! (Probably in the next Node.js patch release).
https://github.com/babel/babel/issues/11216
I have simple solution just downgrade Nodejs version to v10 LTS or 11. For example in my Raisl app, my Dockerfile look like this:
FROM ruby:2.7.1
ARG DEBIAN_FRONTEND=noninteractive
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
ENV RAILS_LOG_TO_STDOUT=true
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -qq -y nodejs yarn vim
#RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends nodejs
COPY Gemfile* /usr/src/app/
WORKDIR /usr/src/app
RUN bundle config --global frozen 1
RUN bundle config set without 'development test'
RUN bundle install
#RUN yarn install --prod
COPY . /usr/src/app/
# RUN bundle exec rake assets:precompile
CMD ["bin/rails", "s", "-b", "0.0.0.0"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With