【发布时间】:2020-03-07 20:06:45
【问题描述】:
我尝试使用typescript 3.7 功能,例如可选链接、空值合并。但是webpack 在转换时给了我一个错误。
app: Module parse failed: Unexpected token (50:40)
app: File was processed with these loaders:
app: * ../../../node_modules/ts-loader/index.js
app: You may need an additional loader to handle the result of these loaders.
app: | export const Layout = (props) => {
app: | const regionsResults = useQuery(regionsQuery, { fetchPolicy: 'cache-first' });
app: > const regions = regionsResults.data?.regions ?? [];
app: | const userItem = useQuery(usersProfileQuery, { fetchPolicy: 'cache-first' });
app: | const handleOnClick = (selected) => props.history.push(selected.key);
``
【问题讨论】:
-
您可以发布您的
packages.json文件吗?
标签: typescript webpack ts-loader