veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

Malformed URI! /login?target=%2F TypeError: Cannot read property 'document' of undefined #87

Closed crapthings closed 3 years ago

crapthings commented 3 years ago

what can cause this error?

Malformed URI! /login?target=%2F TypeError: Cannot read property 'document' of undefined

dr-dimitru commented 3 years ago

@crapthings You haven't provided much details — https://github.com/veliovgroup/flow-router/blob/master/client/router.js#L288 Hope that helps. I think document might not be found on a Server? Where do you get this error?

crapthings commented 3 years ago

codebase kind of large, i just drop-in replace the old one maybe some server side code import shared module let me check first

crapthings commented 3 years ago

i've found this issue not just caused by flow-router but page.js

test with parcel.js and page.js same issue

image

image

page('/about', function () {
  console.log(1123123)
})

page('/', function () {
  console.log(1123123)
})
dr-dimitru commented 3 years ago

@crapthings page.js cause a lot of pain lately, and we are not able to upgrade it to the latest release either — tests won't pass. I'm having in plans a major release completely rewriting FlowRouter as it is bulky and got complex so far. But it would require a lot if time, it's just waiting for my free time 😅

crapthings commented 3 years ago

yeah a meteor tracker aware client router like flow router is very good, we can use this work with any front ui framework.