Open totty90 opened 9 years ago
No, is just the default use case
page('/', function(){
game();
})
page('/terrain', function(){
terrain();
})
page('*', function(){
debugger
})
page({})
Both the '/' and '/terrain' triggers the function twice, but only sometimes. It really called it twice, I've used console.log to test it. Very strange, normally happens after a F5 refresh in google chrome.
It's sounds weird. Can you reproduce it somewhere on jsfiddle or codepen? Try master branch from the rawgit.
It happens like once in 40 times... Is hard to reproduce
It's ok. I can refreshing pages all day long :D But I don't know is it your environment or page.js bug. And if you can help me figure out, then we resolve that issue faster.
Ok. My env is using require.js and many other deps like (+tinycolor)
'facebook' : '//connect.facebook.net/en_US/all'
// 'facebook' : '//connect.facebook.net/en_US/sdk/debug'
'requirejs' : '../bower_components/requirejs/require',
'react' : '../bower_components/react/react-with-addons',
'underscore' : '../bower_components/lodash/dist/lodash',
'futures-requirejs' : '../bower_components/futures-requirejs/future',
'jquery' : '../bower_components/jquery/jquery',
// 'phaser' : '../bower_components/phaser/phaser',
'phaser' : '../thirdParty/phaser/Phaser',
'snap' : '../bower_components/Snap.svg/dist/snap.svg',
'proton' : '../thirdParty/Proton',
'copyProperties' : '../thirdParty/copyProperties',
'flux' : '../bower_components/flux/dist/Flux',
'eventEmitter' : '../bower_components/eventEmitter/EventEmitter',
'pixi' : '../bower_components/pixi/bin/pixi',
'crossroads' : '../bower_components/crossroads/dist/crossroads',
'signals' : '../bower_components/js-signals/dist/signals',
'hasher' : '../bower_components/hasher/dist/js/hasher',
'async' : '../bower_components/async/lib/async',
'socket.io-client' : '../bower_components/socket.io-client/dist/socket.io',
'html2canvas' : '../bower_components/html2canvas/build/html2canvas.min',
'hammer' : '../bower_components/hammerjs/hammer',
'touch-emulator' : '../bower_components/hammer-touchemulator/touch-emulator',
'moment' : '../bower_components/moment/moment',
// 'famous' : '../bower_components/famous',
'tinygradient' : '../bower_components/tinygradient/tinygradient',
'page' : '../bower_components/page/index',
// 'faker' : '../bower_components/faker/dist/faker',
'faker' : '../thirdParty/Faker',
'perlin' : '../thirdParty/Perlin',
I can't reproduce the whole environment easily...
Happened again:
Might not be a production issue... Don't know.
I can confirm and reproduce in last chrome:
Wow, thank you for details!
Happened for me too - a fix that worked in my case, was re-ordering the routes.
From:
page('/products/:cat/:id', productsoverview);
page('/product/:id', singleproduct);
To:
page('/product/:id', singleproduct);
page('/products/:cat/:id', productsoverview);
Can you add some details to your issue? Test case?