You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use the router in a typescript + vite environnement.
I import the library like:
import {Routing} from '~/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router'
(~ is an alias to the root folder)
But when executing I have the following error in the console: Uncaught SyntaxError: The requested module '/@fs/data/xlextent/srcs/financile/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js' does not provide an export named 'Routing' (at routing.ts:3:1)
When I do:
import Routing from '~/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router'
I have the error:
But when executing I have the following error in the console: Uncaught SyntaxError: The requested module '/@fs/data/xlextent/srcs/financile/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js' does not provide an export named 'default' (at routing.ts:3:1)
Here is my tsconfig.json with esModuleInterop ans allowJs set:
I know this is a quite old issue but I came across the same problem.
If you use vite instead of webpack (or it doesn't matter I guess) you can simple import the router.ts file directly instead of using the transpiled js files.
If you yarn add or npm installed ./vendor/friendsofsymfony/jsrouting-bundle/Resources/ then you should be able to import the router.ts file with
I try to use the router in a typescript + vite environnement.
I import the library like:
import {Routing} from '~/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router'
(~ is an alias to the root folder)
But when executing I have the following error in the console:
Uncaught SyntaxError: The requested module '/@fs/data/xlextent/srcs/financile/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js' does not provide an export named 'Routing' (at routing.ts:3:1)
When I do:
import Routing from '~/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router'
I have the error:
But when executing I have the following error in the console:
Uncaught SyntaxError: The requested module '/@fs/data/xlextent/srcs/financile/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js' does not provide an export named 'default' (at routing.ts:3:1)
Here is my tsconfig.json with esModuleInterop ans allowJs set:
What can I do?
The text was updated successfully, but these errors were encountered: