-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Config file (.eleventy.js) dependencies in watch/serve mode are found but not reloaded #2530
Comments
HMM, your test case works for me on Mac OS Monterey. Can anyone else confirm? Are you on Windows? |
Was on Windows 10 last time. Now on Windows 11 with the exact same result! |
Just in case.... I tried all the possible combinations I could imagine down to bare "windows cmd" and npm for the exact same result: |
Getting the same issue on Linux, think this is related #1052
|
The cause of this bug is that file paths in This inconsistency makes Lines 665 to 687 in e9ca971
( I wonder if the platform-dependent style of paths in If it is intentional this should be fixed in However, if the platform-dependent style of paths in Lines 97 to 102 in e9ca971
|
Just did a quick test hoping one/some of the last commits would have solved the problem.... Can anyone else confirm? I would love to close this 😃 |
I believe this was a dupe of #1312 |
I believe I still have this issue. I add all my shortcodes in a loop as follows: .eleventy.js config.addWatchTarget('./_includes/shortcodes/*.js');
const shortcode_files = require("fs").readdirSync("./_includes/shortcodes");
for (const file of shortcode_files) {
const shortcode = require(`./_includes/shortcodes/${file}`);
config.addShortcode(shortcode.name, shortcode.function);
} _includes/shortcodes/myshortcode.js module.exports = {
name: "myshortcode",
function: myshortcode,
};
function myshortcode() {
return "MYSHORTCODE"
} My eleventy version is Basically, I have to stop |
@druskus20 2.0.0-beta.2 has some additional fixes for config reloads, please retest! Via #2773 |
Seems to work now, thanks for letting me know! |
Describe the bug
It seems that any change over
.eleventy.js
dependencies - like filters, shortcodes, etc - is detected but not reloaded. The change is not applied.To Reproduce
With this kind of line:
eleventyConfig.addFilter('outside_filter', require('./site/filters.js').outside_filter);
,any change to the file while running in watch/serve mode, will be logged:
[11ty] File changed: site\filters.js
as expected. But the old code is "still cached".
repo
The text was updated successfully, but these errors were encountered: