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

[web] PathUrlStrategy does not work with nested /test in path #120823

Closed
Cotspheer opened this issue Feb 15, 2023 · 3 comments
Closed

[web] PathUrlStrategy does not work with nested /test in path #120823

Cotspheer opened this issue Feb 15, 2023 · 3 comments
Labels
blocked Issue is blocked by another issue dependency: dart Dart team may need to help us platform-web Web applications specifically team-web Owned by Web platform team

Comments

@Cotspheer
Copy link

Related to the issue 116360 and mentioned in the comment 1431243464 I get an issue when using '/test' as a part of the path. This seems to be a follow up related to the fix by @mdebbar 118684.

Steps to Reproduce

  1. flutter channel stable
  2. flutter create flutter_web_test --platforms=web -t skeleton
  3. Update pubspec.yaml to include flutter_web_plugins
  4. Update main.dart and add 'usePathUrlStrategy();' before runApp. Include import
  5. Change sample_item_details_view.dart.routeName to '/sample_item/test'
  6. Run it in Chrome: flutter run
  7. Navigate to an item
  8. Copy url, open new tab, past and load the url
  • Gets the expected error that this issue is referring to: 'Refused to execute script from 'http://localhost:64151/sample_item/main.dart.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.'
  1. Switch channel to master: flutter channel master
  2. Upgrade flutter: flutter upgrade
  3. Repeat steps 6 to 8
  4. New error related to web_entrypoint.dart.lib.js

Expected results:
Requested url is passed to the apps onGenerateRoute so it can build the requested screen. Therefore requesting http://localhost:64151/sample_item/test renders the output of the sample_item_details_view.dart when requested directly by the browser.

Actual results:

test:1 Refused to execute script from 'http://localhost:52811/sample_item/test/web_entrypoint.dart.lib.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
require.js:143 Uncaught Error: Script error for "web_entrypoint.dart", needed by: main_module.bootstrap
require.js:143 Uncaught Error: Script error for "web_entrypoint.dart", needed by: main_module.bootstrap
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:168:17)
    at HTMLScriptElement.onScriptError (require.js:1738:36)
test:1 Refused to execute script from 'http://localhost:52811/sample_item/test/dart_sdk.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
require.js:143 Uncaught Error: Script error for "dart_sdk", needed by: main_module.bootstrap
Flutter doctor:
require.js:143 Uncaught Error: Script error for "dart_sdk", needed by: main_module.bootstrap
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:168:17)
    at HTMLScriptElement.onScriptError (require.js:1738:36)

Example
flutter_web_test.zip

Flutter doctor:

[√] Flutter (Channel master, 3.8.0-12.0.pre.71, on Microsoft Windows [Version 10.0.19043.2075], locale de-DE)
    • Flutter version 3.8.0-12.0.pre.71 on channel master at D:\Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 31c73fcfeb (77 minutes ago), 2023-02-15 04:43:27 -0500
    • Engine revision bf7d515867
    • Dart version 3.0.0 (build 3.0.0-237.0.dev)
    • DevTools version 2.21.1

[√] Windows Version (Installed version of Windows is version 10 or higher)     

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc3)
    • Android SDK at D:\AndroidSDK
    • Platform android-33, build-tools 33.0.0-rc3
    • ANDROID_HOME = D:\AndroidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)   
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33205.214
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.75.1)
    • VS Code at C:\Users\Nighty\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.58.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.2075]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 110.0.5481.77
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 110.0.1587.41

[√] Network resources
    • All expected network resources are available.

• No issues found!
@mdebbar
Copy link
Contributor

mdebbar commented Feb 15, 2023

This is a problem in dwds, I filed an issue: dart-lang/webdev#1965

@mdebbar mdebbar added the platform-web Web applications specifically label Feb 16, 2023
@annagrin annagrin added the blocked Issue is blocked by another issue label Mar 14, 2023
@flutter-triage-bot flutter-triage-bot bot added the team-web Owned by Web platform team label Jul 8, 2023
@yjbanov
Copy link
Contributor

yjbanov commented Jul 20, 2023

Deduplicating into the dwds issue.

@yjbanov yjbanov closed this as completed Jul 20, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Issue is blocked by another issue dependency: dart Dart team may need to help us platform-web Web applications specifically team-web Owned by Web platform team
Projects
None yet
Development

No branches or pull requests

4 participants