Skip to content

cannot use pug template inheritance #459

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
benblazak opened this issue Jan 10, 2022 · 2 comments · May be fixed by #572
Open

cannot use pug template inheritance #459

benblazak opened this issue Jan 10, 2022 · 2 comments · May be fixed by #572
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@benblazak
Copy link

benblazak commented Jan 10, 2022

bug

cannot use pug template inheritance

test

sample repo: https://github.com/benblazak/_svelte_preprocess__pug_template_inheritance

git clone https://github.com/benblazak/_svelte_preprocess__pug_template_inheritance.git
cd _svelte_preprocess__pug_template_inheritance
npm install
npm run dev -- --open
  • try the mixin link
    • this should work
  • try the template link
    • this should fail with the error message

      Declaration of template inheritance ("extends") should be the first thing in the file. There can only be one extends statement per file.

ideas

i think the reason extends ... is not the first thing in the file is because the svelte mixins are prepended here:

const input = `${GET_MIXINS(identationType ?? 'space')}\n${content}`;

@dummdidumm dummdidumm added enhancement New feature or request help wanted Extra attention is needed labels Jan 12, 2022
@Minasokoni
Copy link

@benblazak Have you found a solution to this issue? This is the exact issue i'm running into

@benblazak benblazak linked a pull request Feb 4, 2023 that will close this issue
2 tasks
@benblazak
Copy link
Author

@Minasokoni I needed the practice, so i submitted a pull request. Till then you can use the branch -- or feel free to improve it (no matter who get's the PR credit, if they're willing to accept a fix) I may not have time to do more than this first submission.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants