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

Not working with TypeScript 5.0.2 #1600

Open
dbartholomae opened this issue Mar 23, 2023 · 4 comments
Open

Not working with TypeScript 5.0.2 #1600

dbartholomae opened this issue Mar 23, 2023 · 4 comments

Comments

@dbartholomae
Copy link

Expected Behaviour

After updating the project to TypeScript 5.0.2, it should build.

Actual Behaviour

It throws errors like this:

Module build failed (from ../../common/temp/node_modules/.pnpm/ts- loader@9.4.2_typescript@5.0.2+webpack@5.76.3/node_modules/ts-loader/index.js):
TypeError: ts.createTemplateHead is not a function

Steps to Reproduce the Problem

Update to TypeScript 5.0.2 in a project using ts-loader.

Location of a Minimal Repository that Demonstrates the Issue.

Will add this in case this is an unexpected issue.

@johnnyreilly
Copy link
Member

interesting - createTemplateHead doesn't appear to be an API ts-loader uses

@Baumgaer
Copy link

In addition it doesn't work anymore when loading other compiler like ttypescript. The reason for this is that ts-loader can't find it anymore.

@johnnyreilly
Copy link
Member

Interesting. So https://github.com/TypeStrong/ts-loader#compiler doesn't work with 5.0? I wonder if that's linked to the (major) changes to the internals of TypeScript that happened as part of 5.0

@MirKml
Copy link

MirKml commented Apr 3, 2023

As I mentioned in another issue, after upgrade all tooling, latest webpack, latest ts-loader, all works fine with Typescript 5.0.x.

My ts-loader configuration for webpack is pretty simple

rules: [
                {
                    test: /\.tsx?$/,
                    use: [
                        "babel-loader",
                        {
                            loader: "ts-loader",
                            options: {
                                onlyCompileBundledFiles: true,
                            },
                        },
                    ],
                },
        ]

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

No branches or pull requests

4 participants