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

Cannot convert undefined to null to object #3

Closed
seanyu4296 opened this issue Jun 16, 2018 · 4 comments
Closed

Cannot convert undefined to null to object #3

seanyu4296 opened this issue Jun 16, 2018 · 4 comments

Comments

@seanyu4296
Copy link

I'm getting this error Cannot convert undefined to null to object

it seems to fail in this line

entries(definitions['process.env']).forEach(writeDefs);

definitions['process.env'] is undefined

definitions has this value

{
'process.env.NODE_ENV': '"production"',
  'process.env.PORT': '3000',
  'process.env.VERBOSE': 'false',
  'process.env.HOST': '"localhost"',
}
@seanyu4296
Copy link
Author

I think i have figured out why this fails. Might be because of this jaredpalmer/razzle#611

I got it working by modifying the code to

  if (isHeroku) {
      delete definitions['process.env.PORT'];
      definitions['process.env.RAZZLE_PUBLIC_DIR'] = '"/app/build/public"';
    }

I'll try to submit a PR

@cultofmetatron
Copy link

seconded, I'm running into this issue myself and cannot get it running on heroku

@erchaves
Copy link

erchaves commented Aug 29, 2018

Ahhh, I realized that I was getting this error because I was using this with Razzle 2 and this is not compatible yet. (i'm using razzle 2.2.0)

There is a PR that fixes this issue for me: Upgrade for compatibility with Razzle 2.

For now, I just pulled down mrwade's branch and that's working for me. Thanks @mrwade!

@xouabita
Copy link
Owner

Hi guys, I merged the PR. It should work now

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

No branches or pull requests

4 participants