Issue 1:
i can build and run the app fine locally but when i try deploying to heroku i get this

remote: -----> Building dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v0.24.6
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: warning fsevents@1.1.1: The platform "linux" is incompatible with this module.
remote: info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: success Saved lockfile.
remote: Done in 22.04s.
remote: Running heroku-postbuild (yarn)
remote: yarn run v0.24.6
remote: $ next build
remote: > Using "webpack" config function defined in next.config.js.
remote: > Failed to build on /tmp/4d8f2909-b5b6-41d7-8a6e-4b7b28b4b1d1
remote: { Error: ./pages/filters.js?entry
remote: Module not found: Error: Can't resolve '../components/layout/Main' in '/tmp/build_92a0c5ebe560c66f11f50502989153c7/pages'
remote: resolve '../components/layout/Main' in '/tmp/build_92a0c5ebe560c66f11f50502989153c7/pages'
remote: using description file: /tmp/build_92a0c5ebe560c66f11f50502989153c7/package.json (relative path: ./pages)
remote: Field 'browser' doesn't contain a valid alias configuration
remote: after using description file: /tmp/build_92a0c5ebe560c66f11f50502989153c7/package.json (relative path: ./pages)
remote: using description file: /tmp/build_92a0c5ebe560c66f11f50502989153c7/package.json (relative path: ./components/layout/Main)
remote: no extension
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main doesn't exist
remote: .js
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main.js doesn't exist
remote: .json
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main.json doesn't exist
remote: as directory
remote: /tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main doesn't exist
remote: [/tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main]
remote: [/tmp/build_92a0c5ebe560c66f11f50502989153c7/components/layout/Main.js]

I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

when i run it locally

yarn run v0.24.6
$ next build
> Using "webpack" config function defined in next.config.js.
Done in 28.74s.

Your Environment

Tech
Version

next
beta

node
7.10.1

OS
Win 10

Issue 2:
Bug report

Edit +++ ON HOLD I just had a lightbulb moment. I will post my discovery/misunderstanding in the next few hours. This ticket can probably be closed then, but I have to test my new theory first…

Describe the bug

Multiple (duplicate) meta tags such as charSet and viewport are rendered in <head> section of the HTML output when the <Head> component is used in both a custom _document and a page file.

Even relying on the default injection of <meta charSet="utf-8"/> (i.e. not specifying that tag at all) results in having two of the same tags in the output HTML, one from Document and one from the page.

I also end up with two viewport meta tags, one from Document and one from the page.

To Reproduce

I have created (failing) tests here: https://github.com/Manc/next.js/tree/test-head-document

Clone repository git@github.com:Manc/next.js.git

Check out branch test-head-document

yarn install

yarn testonly --testPathPattern "app-document" -t "It dedupes head tags with the same key"

Expected behavior

I expect the meta tags with the same key to override the meta tags from the custom Document (_document).

I expect only to have one charset and one viewport tag in the whole rendered HTML.

System information

OS: macOS

Version of Next.js: latest or canary branch

Other

I'm pretty new to Next.js and don't really know how it all works yet. I hope the test I provided helps somebody more experienced to fix this or maybe give me a hint. Thanks!

My suspicion is that the Head component of the Document (import { Head } from 'next/document') and the Head component used in the page (import Head from 'next/head') might be completely separate and don't "communicate" with each other, each doing their own thing twice.