mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

absolute import fail during build process in digital ocean dokku deployment. NODE_PATH=src #162

Closed shsunmoonlee closed 5 years ago

shsunmoonlee commented 5 years ago

Describe the bug

Thanks for the great work! I'm deploying the app to dokku with .env looking like this

.env NODE_PATH=src NPM_CONFIG_PRODUCTION=false

.buildpacks https://github.com/mars/create-react-app-buildpack.git

package.json "scripts": { "dokku": { "predeploy": "", "postdeploy": "" }, "start": "react-scripts start",

error response

-----> Build
       Running build

       > fusion-software@0.1.0 build /tmp/build
       > react-scripts build

       Creating an optimized production build...
       Failed to compile.

       ./src/components/Clients/WhatWeOffer.js
       Cannot find module: 'assets/img/Enterprise.svg'. Make sure this package is installed.

       You can install this package by running: npm install assets/img/Enterprise.svg.

Did you try recovering your dependencies?

yeah

Which terms did you search for in User Guide?

absolute import deploy build fail

Environment

it's on digital ocean dokku

Steps to reproduce

explained above

Expected behavior

absolute import works normally

Actual behavior

explained above

Reproducible demo

explained above

shsunmoonlee commented 5 years ago

when I run npm run build on mac, it build without issues, but it only happens when I deploy to dokku

mars commented 5 years ago

This buildpack only supports Heroku.