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

Running serve overwrites original lambda #18

Closed
kchung opened this issue Mar 31, 2018 · 1 comment
Closed

Running serve overwrites original lambda #18

kchung opened this issue Mar 31, 2018 · 1 comment

Comments

@kchung
Copy link
Contributor

kchung commented Mar 31, 2018

When running netlify-lambda serve functions/, the command keeps compiling the functions infinitely, bloating and overwriting the original files with every compilation.

I ran the command in the code-examples repo, notice the filesize growing bigger and bigger.

$ ./node_modules/.bin/netlify-lambda serve functions/
Starting server
Lambda server is listening on 9000
Hash: da984e20aebc1ac3f751
Version: webpack 3.11.0
Time: 431ms
    Asset     Size  Chunks             Chunk Names
random.js  2.98 kB       0  [emitted]  random
   [0] ./functions/random.js 424 bytes {0} [built]
Hash: 7369ba5e43bd2af7c5a1
Version: webpack 3.11.0
Time: 23ms
    Asset     Size  Chunks             Chunk Names
random.js  5.74 kB       0  [emitted]  random
   [0] ./functions/random.js 3.18 kB {0} [built]
Hash: f6e8fafb802d3919efd1
Version: webpack 3.11.0
Time: 16ms
    Asset     Size  Chunks             Chunk Names
random.js  8.68 kB       0  [emitted]  random
   [0] ./functions/random.js 6.12 kB {0} [built]
Hash: 77035ca7b401471403d9
Version: webpack 3.11.0
Time: 21ms
    Asset     Size  Chunks             Chunk Names
random.js  11.8 kB       0  [emitted]  random
   [0] ./functions/random.js 9.23 kB {0} [built]
Hash: b5edcfb7c37f7dd11bb8
Version: webpack 3.11.0
Time: 22ms
    Asset     Size  Chunks             Chunk Names
random.js  15.1 kB       0  [emitted]  random
   [0] ./functions/random.js 12.5 kB {0} [built]
Hash: 1ed77f22dbd1c977cbb5
Version: webpack 3.11.0
Time: 24ms
    Asset     Size  Chunks             Chunk Names
random.js  18.6 kB       0  [emitted]  random
   [0] ./functions/random.js 16 kB {0} [built]
Hash: c997d31cc2030de2d4a6
Version: webpack 3.11.0
Time: 20ms
    Asset     Size  Chunks             Chunk Names
random.js  22.2 kB       0  [emitted]  random
   [0] ./functions/random.js 19.6 kB {0} [built]

...

The original function files are also modified, see running git status right after serve:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   functions/random.js

random.js is overwritten with compiled code. This is with the package [email protected].

@ahmedelgabri
Copy link

I think this is a duplicate of #8

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

2 participants