Skip to content

Conversation

7-zete-7
Copy link
Contributor

@7-zete-7 7-zete-7 commented Jul 5, 2022

Q A
Bug fix? yes
New feature? no
License MIT

webpack.config.js:

Encore
    ...
    .enableTypeScriptLoader()
    .enableForkedTypeScriptTypesChecking()

Error message on yarn encore production:

Failed to compile with 1 errors

 error  in vendor/symfony/ux-turbo/Resources/assets/src/turbo_controller.ts:14:8                                                                                                    11:22:22

TS2339: Property 'Turbo' does not exist on type 'Window & typeof globalThis'.
    12 |
    13 | // Expose Turbo to the rest of the app to allow for dynamic Turbo calls
  > 14 | window.Turbo = Turbo;
       |        ^^^^^
    15 |
    16 | /**
    17 |  * Empty Stimulus controller only used for Symfony Flex wiring.

Previously, #331 proposed a different solution, but it was rejected due to the changes already being prepared in hotwired/turbo#280. At the moment, the changes in the second package have been made, as a result of which it is possible to change lines that cause a compilation error.

@7-zete-7 7-zete-7 changed the title Fix TypeScript compilation issue... again [Turbo] Fix TypeScript compilation issue... again Jul 5, 2022
@weaverryan
Copy link
Member

Yep, this is not needed anymore - thanks @7-zete-7!

@weaverryan weaverryan merged commit 9e3097b into symfony:2.x Jul 5, 2022
@7-zete-7 7-zete-7 deleted the ts-compile-fix branch July 5, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants