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

API incompatibility with Eleventy 1.0 #33

Open
mraerino opened this issue Jan 21, 2022 · 1 comment
Open

API incompatibility with Eleventy 1.0 #33

mraerino opened this issue Jan 21, 2022 · 1 comment
Labels
eleventy-1.0 Eleventy 1.0 support

Comments

@mraerino
Copy link

When trying this Plugin with Eleventy 1.0 I get this error:

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] > Having trouble writing template: _site/posts/hello/index.html

`TemplateWriterWriteError` was thrown
[11ty] > The "path" argument must be of type string. Received undefined

`TypeError` was thrown:
[11ty]     TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
        at new NodeError (node:internal/errors:370:5)
        at validateString (node:internal/validators:119:11)
        at Object.resolve (node:path:1098:7)
        at Object.<anonymous> (/Users/christine/code/kalkspace-relaunch/node_modules/eleventy-plugin-react/lib/plugin.js:122:28)
        at Template.runTransforms (/Users/christine/code/kalkspace-relaunch/node_modules/@11ty/eleventy/src/Template.js:553:38)
        at async Template.renderPageEntry (/Users/christine/code/kalkspace-relaunch/node_modules/@11ty/eleventy/src/Template.js:848:15)
        at async /Users/christine/code/kalkspace-relaunch/node_modules/@11ty/eleventy/src/Template.js:872:21
        at async Promise.all (index 0)
        at async Promise.all (index 2)
        at async Eleventy.executeBuild (/Users/christine/code/kalkspace-relaunch/node_modules/@11ty/eleventy/src/Eleventy.js:986:13)

this is likely because, the function context for addTransform callbacks no longer passes outputDir: https://github.com/11ty/eleventy/blob/08fe54e03da025cda24c4b25b5b8a8d0007b4689/src/Template.js#L552-L556
consider using path.dirname(outputPath) instead.

@kaicataldo kaicataldo added the eleventy-1.0 Eleventy 1.0 support label Jan 24, 2022
@kaicataldo
Copy link
Owner

Yeah, this hasn't been updated since v1.0 was released. Haven't had time since it was released, but will hopefully get to it soon. In the meantime, PRs are definitely welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eleventy-1.0 Eleventy 1.0 support
Projects
None yet
Development

No branches or pull requests

2 participants