-
Notifications
You must be signed in to change notification settings - Fork 688
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
🐛 BUG: wrangler pages dev doesn't recompile worker when imported dependency changes #3840
Comments
Thank you so much for raising this issue and providing all the helpful details that you did <3. I was able to reproduce the behaviour you described, so this is indeed an issue. In fact, we have a similar report in #4824. As I mentioned there
I will be picking up these two issues as part of https://github.com/cloudflare/workers-sdk/milestone/10 and will update here once the fix for this particular report is ready. |
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
The watch mode in `pages dev` for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function "math-is-fun.ts", defined as follows: ``` import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); } ``` `pages dev` will reload for any changes in "math-is-fun.ts" itself, but not for any changes in "math/add.ts", which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit fixes all these things, plus adds some extra polish to the `pages dev` watch mode experience. Fixes #3840
Which Cloudflare product(s) does this pertain to?
Pages
What version(s) of the tool(s) are you using?
3.6.0
What version of Node are you using?
18.13.0
What operating system are you using?
Windows
Describe the Bug
When running
wrangler pages dev
the worker is compiled automatically whenever a file in /functions is changed. However, if a dependency of one of those files changes it does not recompile.For example, given
Then when running
wrangler pages dev
any change tofunctions/test.js
will cause the worker to recompile and refreshing the browser page will reflect that. If however the string inlib/lib.js
is changed the worker is not recompiled and refreshing the page in the browser will not reflect those changes.Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: