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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after migrating from 0.9.5 to 1.0.0 i'm getting error message. __webpack_require__.i(...) is not a function #2473

Closed
mromanoff opened this issue Jun 5, 2017 · 13 comments

Comments

@mromanoff
Copy link

mromanoff commented Jun 5, 2017

Description

after migrating from 0.9.5 to 1.0.0 i'm getting error message. webpack_require.i(...) is not a function

Expected behavior

should not be error out.

Environment

  1. npm ls react-scripts (if you haven’t ejected): [email protected] same with [email protected]

  2. node -v: v7.10.0

  3. npm -v: 5.0.0

  4. Operating system: macOS Sierra v 10.12.5

  5. Browser and version: Chrome 58.03029

file url.js

import HOST from "./host";

export const LOGIN_URL = `${HOST}/api/admin/login`;
export const BILLING_PROVIDERS_URL = `${HOST}/api/admin/billing-providers`;
export const PATIENTS_URL = `${HOST}/api/admin/users`;
export const REIMBURSEMENTS_URL = `${HOST}/api/admin/reimbursements`;

browser pause on exception on last line of this file content

@codedavinci
Copy link

Good morning @mromanoff,

Could you please share the file host.js? Is is Environment Variables config on the client side ?

@Timer
Copy link
Contributor

Timer commented Jun 5, 2017

Can you please provide a reproducible demo? This would help greatly to diagnose the issue.

@mromanoff
Copy link
Author

@codedavinci here is content of host.js file

const DEV_API_HOST = '//dev.api.example.com:5000';

let HOST = process.env.NODE_ENV === 'production' ? PROD_API_HOST : DEV_API_HOST;

export default HOST;

I'm running this project locally. HOST is always === DEV_API_HOST
process.env.NODE_ENV value set by heroku

here is package.json if it helps

{
  "name": "atlas",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@mars/heroku-js-runtime-env": "^3.0.0",
    "material-ui": "^0.18.1",
    "moment": "^2.18.1",
    "prop-types": "^15.5.10",
    "react": "^15.5.4",
    "react-dom": "^15.5.4",
    "react-router-dom": "^4.1.1",
    "react-tap-event-plugin": "^2.0.1"
  },
  "devDependencies": {
    "react-scripts": "1.0.7"
  },
  "scripts": {
    "start": "HTTPS=true react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom"
  }
}

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2017

Which line is it erroring on exactly? Can you show a screenshot?

@mromanoff
Copy link
Author

here is test repo. after yarn start try to login. it doesn't matter what user or password you type.
https://github.com/mromanoff/test

@mromanoff
Copy link
Author

@gaearon here is screenshot.
screen shot 2017-06-05 at 11 07 15 am

@codedavinci
Copy link

codedavinci commented Jun 5, 2017

@mromanoff did you try to console.log the env object to see if heroku is passing down properly the variables ?

while ago, I noticed that heroku wasn't passing down dynamically the variables in dev environments.

I don't know if you do have it set up, but you should have a .env file for development purpose with a copy of the variables set in Heroku and a library to translate it such as dotenv in devDependency.

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2017

I can't reproduce this.

screen shot 2017-06-05 at 7 14 50 pm

I just ran npm start. Is there more I need to do to reproduce?

@mromanoff
Copy link
Author

mromanoff commented Jun 5, 2017

@gaearon obviously you can request api end point. you don't have this in your local env. but i get this error message even before i request API.
I can't think of anything else you need to do extra. hmm... i need to dig deeper into this.

@mromanoff
Copy link
Author

@codedavinci process.env.NODE_ENV set by heroku. and it is was shown by console.log correctly.
this issue i have observed in local env and i didn't push this code to heroku.

@codedavinci
Copy link

codedavinci commented Jun 5, 2017

@mromanoff for some reason, I am not being able to reproduce this error.. have you tried to delete the node_modules folder and npm i , just for sake of testing :)

I am not getting this error at all :/

@mromanoff
Copy link
Author

@codedavinci i did this before as it described on your migration docs. now i did this again and this helped at the second try. i don't know why? maybe combination of new npm 5 or just my sloppiness.

Sorry guys for a red flag and thank you for your quick response.

@codedavinci
Copy link

@mromanoff No problem !! I am glad it helped. :)

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants