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

fix: mpa resolve error on Windows #10382

Merged
merged 2 commits into from
Feb 6, 2023
Merged

fix: mpa resolve error on Windows #10382

merged 2 commits into from
Feb 6, 2023

Conversation

AkaraChen
Copy link
Member

@AkaraChen AkaraChen commented Feb 2, 2023

examples/mpa 里 dev 报如下错误:
image
此 PR 尝试修复。

@vercel
Copy link

vercel bot commented Feb 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
umi ⬜️ Ignored (Inspect) Feb 3, 2023 at 0:30AM (UTC)

@fz6m
Copy link
Member

fz6m commented Feb 2, 2023

这个是啥问题,是不是把 import * as x from "${winPath(args.path)}"; 的路径尾部 / trim 一下就好了。

@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Base: 29.29% // Head: 29.29% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (92948ed) compared to base (3e6450b).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10382      +/-   ##
==========================================
- Coverage   29.29%   29.29%   -0.01%     
==========================================
  Files         445      445              
  Lines       13005    13006       +1     
  Branches     3178     3178              
==========================================
  Hits         3810     3810              
- Misses       8591     8592       +1     
  Partials      604      604              
Impacted Files Coverage Δ
...ages/preset-umi/src/features/mpa/extractExports.ts 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AkaraChen
Copy link
Member Author

AkaraChen commented Feb 2, 2023

这个是啥问题,是不是把 import * as x from "${winPath(args.path)}"; 的路径尾部 / trim 一下就好了。

我搞错了,跟那个 issues 和 winPath 无关,是我这边出现了新的错误,根据报错信息修了一下

@fz6m

This comment was marked as resolved.

@AkaraChen

This comment was marked as resolved.

@@ -73,6 +73,7 @@ import * as x from "${winPath(args.path)}";
ret = x.${opts.exportName} || {};
`,
loader: 'ts',
resolveDir: args.path.slice(0, args.path.lastIndexOf('/')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { dirname } from 'path'

dirname(args.path)

Co-Authored-By: 咲奈Sakina <59400654+fz6m@users.noreply.github.com>
@fz6m fz6m mentioned this pull request Feb 3, 2023
@sorrycc sorrycc merged commit 0c568fa into umijs:master Feb 6, 2023
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.

None yet

3 participants