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

netlify dev function not updating #3374

Closed
mcansh opened this issue Sep 21, 2021 · 1 comment · Fixed by #3450
Closed

netlify dev function not updating #3374

mcansh opened this issue Sep 21, 2021 · 1 comment · Fixed by #3450
Assignees
Labels
area: command: dev area: functions type: bug code to address defects in shipped code

Comments

@mcansh
Copy link

mcansh commented Sep 21, 2021

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Run git clone git@github.com:mcansh/netlify-require-cache.git
  2. Navigate to the cloned repository
  3. Run netlify dev and ./build.cjs --watch
  4. make a change to ./src/index.js
  5. notice that the dist file (netlify/functions/server/dist/index.cjs) is updated and whats shown in the browser is not

Configuration

  • If possible, please copy/paste below your netlify.toml.
[build]
  functions = "netlify/functions"
  publish = "public"

[dev]
  functions = "netlify/functions"
  publish = "public"
  port = 3000
  autoLaunch = false

[[redirects]]
  from = "/*"
  to = "/.netlify/functions/server"
  status = 200

[[headers]]
  for = "/build/*"
  [headers.values]
    "Cache-Control" = "public, max-age=31536000, s-maxage=31536000"
  • Please enter the following command in a terminal and copy/paste its output:
npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli
  System:
    OS: macOS 12.0
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 786.18 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - ~/.n/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 7.24.0 - ~/.n/bin/npm
  npmGlobalPackages:
    netlify-cli: 6.9.9

Expected behavior

the require cache would be updated and show the latest changes

CLI Output

If applicable, add the CLI output to help explain your problem.

Additional context

Add any other context about the problem here.

@netlify-team-account-1
Copy link
Contributor

Hi @mcansh, thank you for reporting this error! I was able to reproduce it locally. I'll circle around internally to find what we'll do about it.

To unblock yourself, you can use the esbuild bundler. That solved the issue for me:

# netlify.toml

+ [functions]
+   node_bundler = "esbuild"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: dev area: functions type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants