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

DtsPlugin not working with multiple domains in host and HTTPS protocol with self-signed certificate #2332

Open
5 tasks done
dimohqa opened this issue Apr 15, 2024 · 5 comments
Assignees

Comments

@dimohqa
Copy link

dimohqa commented Apr 15, 2024

Describe the bug

If the static files are served by the webpack-dev server with the host localhost.example.com, then when you try to load the manifest using the DTS plugin, the URL is transformed into 127.0.0.1.example.com/mf-manifest.json. This results in an error:

cause: Error: getaddrinfo ENOTFOUND 127.0.0.1.example.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: '127.0.0.1.example.com'
  }
}

This problem is solved by adding lines like this to ets/hosts:

127.0.0.1 127.0.0.1.example.com
127.0.0.1 localhost.example.com

And adding the allowedHosts: 'all' property to the devServer

After that, when you try to call https://127.0.0.1.example.com:4178/mf-manifest.json an error occurs:

cause: Error: self-signed certificate

Reproduction

Turn on https/ssl for example test apps react-ts-host and react-ts-remote
OR
https://github.com/dimohqa/example-mf-dts-bug

Used Package Manager

npm

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M2
    Memory: 62.02 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
    pnpm: 8.15.6 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.123
    Safari: 17.4.1

Validations

Copy link
Contributor

Hello @dimohqa. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 5 days.

@dimohqa
Copy link
Author

dimohqa commented Apr 17, 2024

Added repo for reproduction:
https://github.com/dimohqa/example-mf-dts-bug

@zhoushaw
Copy link
Collaborator

@2heal1 Help with this issue

Copy link
Contributor

As the issue was labelled with need reproduction, but no response in 5 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, see Why reproductions are required.

由于该 issue 被标记为 "需要重现",但在 5 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 为什么需要最小重现

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
@zackarychapple
Copy link
Collaborator

Reproduction was added @zhoushaw @2heal1

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