Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

ZEIT

Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.

ZEIT / General

Now-Build Compiles `index.html` into `main.js`.

Now-Build Compiles `index.html` into `main.js`.

ZEIT/General · December 5, 2018 at 11:37am

Now-Build Compiles `index.html` into `main.js`.

ZEIT / General · December 5, 2018 at 11:37am
Hi there, after a successful deploy, I found that my app doesn't work because, for some reason, now-build compiles my index.html into my main.js instead of my JS bundle file. See image below. I don't know exactly what I'm doing wrong, building locally works just fine. I'm building with webpack.





December 5, 2018 at 11:39am

Can you post your now.json?

  • reply
  • like

December 5, 2018 at 3:48pm
{
  "version": 1,
  "dotenv": ".env.now",
  "files": [
    "public",
    "plugins",
    "views",
    "webpack.config.js",
    ".babelrc",
    ".eslintrc.json",
    "package-lock.json",
    ".env",
    ".env.now",
    "src",
    "scr/config/app-secret-keys.js",
    "scr/config/lezplay-216101-e2b48d13d959.json",
    "client/src",
    "client/src/ionicons-3.0/dist",
    "client/package.json",
    "client/webpack.config.js",
    "client/.babelrc.js",
    "client/.eslintrc.json",
    "client/.package-lock.json"
  ]
}

  • reply
  • like

Sure!

  • reply
  • like
  • reply
  • like

Can you make a repo so I can investigate into it further?

  • reply
  • like

@paulogdm Sure, I can give you access to my private Bitbucket repo. Is that fine?

  • reply
  • like

December 5, 2018 at 6:09pm

Let's hope. My email is paulo@zeit.co

  • reply
  • like

December 5, 2018 at 9:53pm

Hey Paulo, just sent you an invite. Thanks so much for your're help.

  • reply
  • like

@justice-mba I saw and needed to decline. Could you zip and send a link to me?

Atlassian is requiring me to create an account and follow additional steps that I rather not do...

  • reply
  • like

December 5, 2018 at 11:18pm

December 6, 2018 at 11:03am

Good morning Paulo.

  • reply
  • like

Hello! At first sight, I'm concerned about these:

- /uploads are you trying to upload stuff to the lambda? Do you know that only /tmp is writable?

- /src/socket-factory.js we do not support sockets yet in our v2 platform. I tried to locate where we have this information in our documentation and it seems we don't. I will make sure to add it.

  • reply
  • like

I'm also trying to understand if the folder "exec -l" is a mistake or intentional...

  • reply
  • like

Do you only need the build folder in the cloud? Like our "create-react-app" example? https://github.com/zeit/now-examples/tree/master/create-react-app

  • reply
  • like

hey thanks so much.

yes, I'm aware of /tmp . My immediate need for now is to build and server my client bundle main.js correctly.

I'm currently using v1 platform. I believe that supports socket right?

The exec-l is not needed, that's why I excluded in the files config in now.json

Edited
  • reply
  • like

NO. The build folder doesn't need to be in the cloud since now builds the app. However, I've considered building locally and then pushing just the build folder to the cloud. But my only constraint with that is, my client needs to know the BASE_URL of my app, process.env.now-url, which I can only get during now-build

Edited
  • reply
  • like

Now V1 should be an environment very close to what you have in your local machine. I will try to investigate why your build process is not working...

like-fill
1
  • reply
  • like

I am not able to build your app locally.

Can you run rm -rf node_modules && npm i and then build?

  • reply
  • like

December 6, 2018 at 1:58pm

I am not able to build your app locally.

Can you run rm -rf node_modules && npm i and then build?

Absolutely!

You'll need to do that both in the root folder and in the client folder. (I should've added a script to do all those.)

After install, run npm run build-local from the root.

Edited
  • reply
  • like

December 6, 2018 at 11:22pm

HI Paulo, any success?

  • reply
  • like

Negative. Got busy through the day, give me 2 more days. Your codebase is rather complex and I'm trying to cut pieces to get down to the problem.

  • reply
  • like

Thanks so much. I'm sorry for all the troubles.

  • reply
  • like

December 9, 2018 at 9:30pm

Hey Justice, I took a look at your code and I think I have some news. I'm away from my work computer but I can report my findings tomorrow! Cheers!

  • reply
  • like

December 10, 2018 at 12:00am

Yayy! Thanks so much Paulo!

  • reply
  • like
Your message here...

*bold*_italic_`code````codeblock```