Comments (8)
Thank you for the report ❤️ . The fix release in v0.5.4
from amp-module.
@farnabaz I said hooray too fast, unfortunately it does not fix the issue.
It still fails here:
switch (ampMode) {
case true:
case 'only':
isAMP = true
ampMode = 'only'
if (options.amp && hasAMPPrefix) {
return ctx.error({ statusCode: 404, message: 'This page could not be found' })
}
break
Setting mode to hybrid
, with both routes handled as separate nuxt pages, is the workaround I found to skip this check for now.
from amp-module.
Thank you for sample ❤️
Your workaround is the correct way to create amp pages. You don't need to set amp: true
in pages under /amp
directory. All pages under /amp
directory will mark as AMP.
Just to mention, This condition if (options.amp && hasAMPPrefix) {
, should be here to prevent generating duplicate page on static generation.
from amp-module.
This seems an issue of routes generation.
from amp-module.
Oh I see, my bad.
I was misunderstand your problem (BTW, The outcome is good. I found another issue 😄)
Could you provide a simple reproduction on codesandbox?
from amp-module.
Sure, I managed to reproduce, breaking the nuxt-amp codesandbox working example 😅
https://codesandbox.io/s/nostalgic-grothendieck-vhf6n
Using the example /hello and /amp/hello routes.
Basically I set mode: false
as default in nuxt config, then overridden with amp: true
in /amp/hello and now it's broken
from amp-module.
Oh, I see! Maybe it could be worth mentioning it in the docs? amp: true
could be misleading in this case
from amp-module.
Sure it does. Unfortunately I did not do well in documenting the module. I'll update the docs ASAP.
from amp-module.
Related Issues (20)
- Action Required: Fix Renovate Configuration
- How do I change the url structure of amp pages to be pageurl+?amp HOT 1
- Yarn 2: explicit webpack dependency HOT 1
- loader without sass HOT 2
- amp-next-page version HOT 1
- the style doesn't work in any AMP page HOT 4
- amp-story-player not found in amp-module HOT 3
- Should tree shaking be working? HOT 1
- Support for converting <nuxt-img> and <nuxt-picture> into <amp-img> on AMP pages
- Setup the GoogleAnalytics? HOT 2
- Fatal error when running this module in typescript project
- Dependency Dashboard
- How to include inline js in AMP mode with nuxt HOT 1
- script property is not working in head() HOT 1
- Nuxt 3 support HOT 3
- amp custom-element(s)
- Why most javascript function not working? HOT 1
- https://cdn.ampproject.org/v0/validator_wasm.js - read ETIMEDOUT
- Nuxt 3 Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amp-module.