In Noah Kahan’s Flannel World, You’re the Main Character
An evening of teens and tears with the newly crowned prince of Stomp and Holler 2.0.
ByRebecca Alter,
a staff writer who covers comedy and pop culture
One of Noah Kahan’s home-state shows in Gilford, New Hampshire, in September.
Photo: Emmie America
One of Noah Kahan’s home-state shows in Gilford, New Hampshire, in September.
Photo: Emmie America
This article was featured in One Great Story, New York’s reading recommendation newsletter. Sign up here to get it nightly.
When it’s 90 degrees at 6 p.m., flannel shirts wrapped around jean-shorted waists are so foolishly optimistic, so delusional, they circle back around to almost tragic. But everyone’s wearing them, including myself (how do you do, fellow teens?) in rugged, muted blues and greens; flannel is back, but my friend Sophie points out the punky red-and-black check of our ill-advised hipster youth is decidedly out. The sad, sweat-soaked flannel is the first thing I clock when I walk through the sunny open field turned parking lot to the BankNH Pavilion in Gilford, New Hampshire, where Gen Z’s New England royalty, Noah Kahan, is playing his first of two sold-out headline shows for a crowd of 9,000 a pop amid an early-September heat wave. That number may be a drop in the bucket compared to his 1.5 million followers on TikTok, but Kahan is a long way from where he was last year, playing for audiences of a couple hundred at small festivals. And his pop-inflected folk hits different in front of Northeasterners.
Kahan grew up nearby, between Hanover, New Hampshire, and Strafford, Vermont.This summer, Kahan exploded, thanks to a reissue of his breakout third album, 2022’s Stick Season, featuring seven new songs, that landed him at No. 3 on “The Billboard 200.” After topping the rock and alternative charts, he finally hit “The Hot 100,” peaking at No. 25 in August for “Dial Drunk,” his rollicking, banjo-fueled single featuring Post Malone, which he teased on TikTok with the chef’s-kiss word-play “I dial drunk, I’ll die a drunk, I’d die for you!” This month, he was featured on new country star Zach Bryan’s latest EP, and next summer, Kahan will cap-off a huge North American stadium tour with two nights playing New England’s most consecrated ground, Fenway Park. His album’s namesake single, Stick Season, refers to “the time of year in Vermont, ‘stick season,’ when all the leaves are off the trees,” he told the lyrics site Genius in January. “It’s a term that was used by some of the older folks in the town I grew up in to describe this really miserable time of year when it’s just kind of gray and cold, and there’s no snow yet, and the beauty of the foliage is done.”
It’s an apt description for all of his music: Kahan sings from a perspective situated inside a childhood bedroom or from a passenger seat, staring out the windows onto familiar landscapes at the bleakest and most desolate times of the year, metaphors for sensitive-suburban-boy ennui. His fans say they like him for one of two reasons: his openness about mental health (he sings and posts extensively about depression and positive experiences with therapy) and the way his music captures what it’s like to grow up in this region, an underexamined point of view versus the mythologized teendoms of, say, California or Texas.
“Like, he talks about the certain feelings that you get from our seasons, like in ‘Homesick,’ about how it’s always cloudy and it feels isolating,” Delaney, a teen in clear-rimmed glasses tells me while playing cornhole with her mom on the lawn outside the venue. The two drove up from Boston. “That’s why I like that song a lot. Because I know what that is. I’ve been through that.” Clouds can be so deep when you’re 16.
There are tons of mothers and daughters here, younger teens in need of rides and supervision, and women in their early 20s whose own personal-favorite coming-of-age New England media is almost certainly Gilmore Girls. There are straight couples, too; blonde women and softboys who get it; a boyfriend with a Nalgene carabinered to his cargo shorts and a T-shirt that reads corgzilla with a corgi on it who walks by another boyfriend in a shirt that reads poodle dad. And: mohawk-mullet boyfriend. American-flag-print Vineyard Vines–whale boyfriend. Matching-tour-shirts glasses boyfriend. There are also lots of lesbian couples and BFF duos holding hands.
Beyond flannel girls and doggo-tee boys, the Kahan phenomenon feels like a revival of a moment that went away (or so we thought) only around a decade or so ago: “Stomp and Holler,” the semi-posthumous name given by Spotify to a genre that peaked between 2010 and 2013, defined by acts like Mumford & Sons, the Lumineers, the Avett Brothers, Of Monsters and Men, and Hozier. A time when the alt charts were taken over by the Country Bear Jamboree. This is “Ho Hey” music, folkish adult contemporary and rock featuring very strummy guitars, banjos, mandolins, or ukes; big rousing kick-drum and stomp-clap arena-ready refrains; and coal-miner-cosplay aesthetics. Like a bare Edison bulb at a nouveau taco joint, all of these stylistic decisions were meant to project “authenticity,” but by trying so intentionally, and by ignoring the aesthetic realities of the time (namely the explosion of social media), they came off as forced and fake. None of this is a judgment of the actual quality of the music. As in any genre, there were good and bad actors, and people can be deeply moved by either. It’s just to say that, in the Gen-Z (and Gen-Alpha?) retro nostalgia cycle, a phenomenon that might still seem recent enough to be uncool to the olds is already coming back around like Y2K and indie sleaze before it.
.
.
What other music does a group of college-age girls I chat with listen to? “Vibey, sad-boy music," one tells me. Photo: Emmie America.
What other music does a group of college-age girls I chat with listen to? “Vibey, sad-boy music," one tells me. Photo: Emmie America.
Kahan’s got the stompable, soaring choruses and acoustic-folk riffs — not to mention the beard and the man bun — but he evades Old Stomp and Holler’s authenticity issue by eschewing stylized Americana imagery for real, relatable, personal lyrics about house parties and people moving away to college. When he sings, “The intersection got a Target / And they’re calling it ‘downtown’” on “New Perspective,” that’s social realism, baby.
More than Vermont or New Hampshire, his music really lives, spiritually, on TikTok. In October 2020, he uploaded a video to the platform in which he sings a throwaway verse, a catchy acoustic ditty hashtagged “#depressedjasonmraz #prozackeanureeves.” It ends: “I’m terrified of weather ‘cus I see you when it rains / Doc told me to travel but there’s COVID on the planes / I’m fucked/I’m fucked/and I suck. You suck. And this sucks. Fuck…” Both the video and song went viral, so he took out the F-bombs and replaced them with a chorus, which went on to become “Stick Season.” He’s constantly interfacing with fans, making self-deprecating jokes, trying out new stuff for them, or duetting with their covers. Outside the venue, I see two girls with flat-ironed hair, snacking in the shade of a giant inflatable Jäger bottle, in custom T-shirts featuring tweets of Kahan’s: one says “Daddy likey,” another says “Daddy is a corporate sellout.” They each tell the other that they should tweet their shirt at him.
I start chatting with 20-year-old UNH English major Emma and her 18-year-old friend Hailey. They belong to a segment of Kahan’s fan base that self-identifies as “long-distance daughters” who post TikToks of themselves, sometimes crying or freshly post-cry, with captions about all of their big feelings — guilt, heartbreak, loss, wistfulness, nervousness — concerning moving away from their hometowns and families. They plan on getting matching tattoos of the Kahan lyric “I do not exist to die.” It’s the introspective, emo alternative to RushTok with millions of girls narrating their first summers away from home as if they’re each starring in their own coming-of-age Sundance feature. (One thing that hasn’t changed since the first Stomp and Holler wave is that it attracts the whitest crowd imaginable.) They resonate with the way Kahan sings about that transitional period in one’s life. They post these sobbing selfie videos to the chorus of his song, “You’re Gonna Go Far,” which is sung from the perspective of the people who stay behind (“We ain’t angry at you, love / You’re the greatest thing we lost … And we’ll all be here forever”).Connor, a 22-year-old in town from Maine for Noah Night Two, puts it this way: “He talks about small big problems.” It’s music to be a main character to.
Inside the venue, I buy a can of Noah Kahan’s Northern Attitude IPA (yes, he has his own IPA collab) to bring to my seat for a full 4-D experience. It’s the right choice: Kahan opens with his song “Northern Attitude,” one of his liveliest Mumfordian tracks: “If I get too close / And I’m not how you hoped / Forgive my northern attitude / Oh, I was raised out in the cold.” My friend, who is from the U.K. and grew up going to punk shows as a teen, tells me this is the single loudest crowd she’s ever heard. A couple of girls hold signs up toward the front of the pit. One is sort of a giant, bedazzled version of his driver’s license that says “Daddy” where his name should be. Another says “THIS SEXY JEW GOES TO THERAPY.” A disgruntled, pink-faced dad, here with his wife, queer-presenting adult kid, and kid’s queer-presenting adult girlfriend, screams over the guitars: “Put your sign down!” All of the boyfriends standing with their arms crossed are singing along to every word.
“I think when people hear the words ‘Stomp and Holler,’ they think the Lumineers or something. And, honestly, that’s pretty accurate,” says one fan. “It’s very much, like, a ‘Gather round, let’s sing a song’ folky kind of deal.” Photo: Emmie America.
“I think when people hear the words ‘Stomp and Holler,’ they think the Lumineers or something. And, honestly, that’s pretty accurate,” says one fan. “... “I think when people hear the words ‘Stomp and Holler,’ they think the Lumineers or something. And, honestly, that’s pretty accurate,” says one fan. “It’s very much, like, a ‘Gather round, let’s sing a song’ folky kind of deal.” Photo: Emmie America.
Kahan introduces himself to the crowd as “Jewy Tomlinson” and “Jewish Capaldi,” before launching into the simple folk-groove of “She Calls Me Back” (Kahan is a nice Jewish boy; the song begins, “There was heaven in your eyes / I was not baptized”).When Kahan performs, his eyes get wide and he darts them side to side in close-up on the big screens. His tenor is polished and mercifully much less cursive in person, especially shining on all the mmms and ohhhs peppering his songs. He prefaces a song that more directly addresses mental health, “Growing Sideways,” by saying, “When I was a kid, I was depressed. I’m still depressed, but I was depressed-er. I don’t know what was wrong with me. I spent hours playing Club Penguin and watching NBA dunk compilations.” He doesn’t entirely mean it as a joke, and the audience doesn’t entirely take it as one, cheering their support, cheering for feeling seen. He adds, “I know I look like I’ve been through a grizzly divorce and custody battle, but I’m only 26.” You quickly understand that Kahan is never self-serious — an emotional and sensitive songwriter, yes, but with the goofy energy of a friend’s nonthreatening elder brother who has more depth than he lets on.
At one point in his show, Kahan takes a moment to shout-out everyone who came alone. “I literally go to fucking hibachi by myself,” he says. “Everyone feels sad for me. I tell them it’s my birthday; they throw a whole zucchini in my mouth.” It’s a testament to the way he manages the tone of the show that he can say all that and then, one song later, I have goose bumps and catch myself crying.
The Stomp and Holler revival feels real — even if no one’s calling it that anymore — especially hearing people go wild for a mandolin solo. There are two teen girls to my right in two separate rows, one in front of the other, both here with their parents. As they sing along, they sob and hold their hands to their hearts, feeling everything and looking so devastated. They both film themselves while they do it, turning their cameras around to selfie mode to capture the single most overwhelming experience of their young lives.
.
.
The venue is full of brand activations and diversions before the show, like a booth showcasing farming equipment, where a rep talks to some distracted-looking college-age girls about tractors. Also featured: cornhole and a little pond with paddleboats. Photo: Emmie America.
The venue is full of brand activations and diversions before the show, like a booth showcasing farming equipment, where a rep talks to some distracted... The venue is full of brand activations and diversions before the show, like a booth showcasing farming equipment, where a rep talks to some distracted-looking college-age girls about tractors. Also featured: cornhole and a little pond with paddleboats. Photo: Emmie America.
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(12),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(1),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),auth.isSubscriber()&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"1":1,"4":4,"12":12,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(406),Fingerprint2=require(408),DS=require(407),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(406),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"406":406,"409":409}];
window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});
}, {}];
window.modules["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy"}];
window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);
}, {}];
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o typeof key === 'string' && key.match(/\.legacy$/)).forEach(key => window.require(key));
}
function tryToMount(fn, el, name) {
try {
fn(el); // init the controller
} catch (e) {
const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML));
console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e);
}
}
/**
* mount client.js component controllers
*/
function mountComponentModules() {
Object.keys(window.modules).filter(key => typeof key === 'string' && key.match(/\.client$/)).forEach(key => {
let controllerFn = window.require(key);
if (typeof controllerFn === 'function') {
const name = key.replace('.client', ''),
instancesSelector = `[data-uri*="_components/${name}/"]`,
defaultSelector = `[data-uri$="_components${name}"]`,
instances = document.querySelectorAll(instancesSelector),
defaults = document.querySelectorAll(defaultSelector);
for (let el of instances) {
tryToMount(controllerFn, el, name);
}
for (let el of defaults) {
tryToMount(controllerFn, el, name);
}
}
});
}
// Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies,
// services, or components that could require it
// note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.js
window.process = window.process || {};
window.process.env = window.process.env || {};
if (!window.process.env.NODE_ENV) {
window.process.env.NODE_ENV = '';
}
// note: legacy controllers that require legacy services (e.g. dollar-slice) must
// wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted first
mountLegacyServices();
mountComponentModules();
// ]]