-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Compile failure with Next app using typescript functions from .ts file #2249
Comments
I'm experiencing the exact same thing.... Seems I have to change everything to .tsx files |
I'm also experiencing the same thing. Kind of a bummer has I was starting to migrate our current monorepo project to |
Finally able to investigate the issue. Seems to be working, that was an easy fix 🙂 |
Will this be released in patch version soon? |
I am also affected by this - what is the ETA for a fix making it into a release? |
#2276) * fix(nextjs): fix issue where using .ts files in next.js app would result in a compile error The issue was just a misconfiguration in the next's config.ts file: Webpack was only applying the babel loader on .tsx files. The updated regex will now load both .ts and .tsx files. ISSUES CLOSED: #2249 * cleanup(testing): add missing tests for pull request #2276 Co-authored-by: tdnll <40502786+tdnll@users.noreply.github.com>
Your comment doesn't make sense at all unless you let everyone know how did you fix that. |
Have you tried looking at the pull request linked just above the message from 2020? |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
Expected Behavior
Next app page should render using utils functions from a .ts file.
Current Behavior
The page displays a "Failed to compile" error
Failure Information (for bugs)
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
nx g @nrwl/next:app myapp
)nx g @nrwl/workspace:lib utils --directory=mydirectory
)Here is a repository with an example: https://github.com/tdnl/nx-test
After cloning and installing the dependencies, run
nx serve myapp
to see the error.Note that if we rename the utils file from .ts to .tsx, the page will load correctly.
Context
Please provide any relevant information about your setup:
The text was updated successfully, but these errors were encountered: