The top-level-await experiment is not enabled

When we try to call an async function with await from a .tsx file in a Next.js React TypeScript web application we get the error message:

Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)

The new versions of Next.js comes with Webpack 5, which supports top level await, but we need to enable it for Next.js too.

  • Open the next.config.js file in the root directory of your Next.js React TypeScript web application
  • Add the following section to it
module.exports = {
  webpack: (config) => {
    config.experiments = { ...config.experiments, topLevelAwait: true };
    return config;
  },
};


Module not found: Can’t resolve ‘fs’

If you use Webpack version 5 or later you may encounter the error message

Module not found: Can’t resolve ‘fs’

The cause is, that Webpack 5 has a breaking change, and the “fs” module is most likely not included anymore in the client-side code.

To eliminate the issue, add the “browser” element to the package.js file under dependencies:

{  
  "dependencies": {
   ...
  },
  "browser": {
    "fs": false,
    "os": false,
    "path": false
  }
}

If the error persists, add the “fs”, “os” and “path” elements to the fallback element in the webpack.config.js file:

module.exports = function (webpackEnv) {
  ...
  return {
   ...
    resolve: {
      ...
      fallback: {
        "fs": false,
        "os": false,
        "path": false,
      }
    }
  }
}

Linking between pages in multi page Next.js React web applications

The Next.js React sample project only contains a single “Index” page. If your web site has multiple pages, you need to set up simple routing to call them from each other.

In this example we will use the “Link” Next.js React component to call two pages from each other with the minimum number of instructions using TypeScript.

Create the pages

File location

For automatic routing we need to place our pages into the “pages” directory. We can use nested folders, but in that case the call has to include the folder name too.

File locationURL
pages/index.tsx/ (index is the default file in every directory)
pages/addresses.tsx/addresses
pages/company/index.tsx/company (index is the default file in every directory)
pages/company/people.tsx/company/people

Requirements

  • Import the “Link” React component. It will automatically generate the URL to the referenced page,
  • “export” the function to make it available for routing,
  • Use the “<Link href=>” element to specify the target page hyperlink,
  • {/* */} is the comment block in React,
  • We use the .tsx file extension in our TypeScript applicaiton.

The code

This is the minimum code you need to call a page within your Next.js React web application.

The “pages/contact.tsx” file

// Import the Link component from next/link
import Link from 'next/link'

// Export the function to make it available to other modules
export default function Contact() {
  return (
    <>
    {/* Text on the page. */}
    This is the Contact page.<br/>
    {/* The link to the other page */}
    <Link href="/about">About</Link>
    </>
  )}

The “pages/about.tsx” file

// Import the Link component from next/link
import Link from 'next/link'

// Export the function to make it available to other modules
export default function About() {
  return (
    <>
    {/* Text on the page. */}
    This is the About page.<br/>
    {/* The link to the other page */}
    <Link href="/contact">Contact</Link>
    </>
  )}

How to name individual street segments in Cities: Skylines

The Cities: Skylines AI automatically estimates the length of the street, and the name applies to the entire length. In real life after a turn, a corner, or an intersection the street’s name can change.

To adjust the street segment where the name applies:

  • Click the name of the street and select the Adjust Road icon
  • Click the segment you want to name, and the small dot will appear
  • Move the end of the original segment to designate the new street segment. The large dot will jump through the turns and intersections.

How to tow a trailer if a loading crane is installed in SnowRunner

If a loading crane is installed on the truck, it usually you cannot attach a trailer. You can tow the trailer with the winch, but you have to load the trailer yourself, as the automatic loading only works with attached trailers.

At the pickup location

  • Auto load the light cargo to your truck (bricks),
  • Transfer the cargo to the trailer with the loading crane,
  • Auto load the heavy cargo (metal beams) to your truck and pack it,
  • Tow the trailer with the winch to the destination.

At the destination

  • Release the winch to park the trailer at a convenient location close to the loading dock where you can later park next to it with the truck,
  • Unload the heavy cargo from your truck,
  • Transfer the light cargo from the trailer to your truck,
  • Pack the cargo, otherwise you cannot auto unload it,
  • Drive the truck to the unload ramp,
  • Unload the cargo from the truck

SnowRunner configuration

If you experience pauses in the video try to change the following video settings:

  • Display Mode
    • Try Borderless on multi-monitor setups. It runs the game in a window, but looks like full screen. You can easily move the mouse between monitors for multitasking.
    • Fullscreen may give you more resources, try it if borderless gives you lag.
  • Antialiasing – OFF
  • Sharpening – OFF
  • Visual Quality Preset – High

SnowRunner – Michigan, USA (spoiler)

Black River

LocationHasNeeds
WarehouseBricks (1 unit)
Concrete blocks (1 unit)
Service spare parts (1 unit)
Metal beams (2 unit)
TaskWhatFromToNotes
ContractWhatFromToNotes
Pipe DreamHeavy Fuel Tanker Semi-Trailer

Bricks x2 (1 unit)

Metal Beams x1 (2 units)
Garage

Warehouse
Warehouse
Factory
Factory
Factory
Fuel trailer notes:
When you arrive to the factory with the fuel trailer fill up your truck from it and park the fuel trailer anywhere in the factory. It will disappear when the rest of the goods are delivered and the contract completed.

Bricks, Metal beams notes:
There is a 2 unit trailer in the warehouse. You can deliver the bricks and the beams at the same time. See How to tow a trailer if a loading crane is installed in SnowRunner if you cannot attach a trailer to the truck because you have a loading crane installed.
Not a drillMetal beams x2 (2 units each)

Oil Rig Drill x1 (5 units)

Construction rig semi-trailer (high saddle needed)
Warehouse

Service site in Smith Dam

Factory
Drilling siteUse a trailer to carry both beams at the same time.

Smithville Dam

LocationHasNeeds
Service HubService spare parts (1 unit)
Oil rig drill (5 units)
Vehicle Spare Parts (1 unit)
There is a Garage North west of the Service Hub
FarmConsumables (1 unit)
North-West cornerRamped flatbed trailer with 2x steel beams(Moved to Drilling Site)
North-West cornerFlatbed trailer with 2x Vehicle spare parts(Moved to Drilling Site)
South-West WarehouseWooden planks (1 unit)
Concrete blocks (1 unit)
Metal beams (2 units)
TaskWhatFromToNotes
More FuelFuel x2Drilling SiteForester’s House
Rock OnService spare parts x2Service HubRoad block next to garageThere is a Garage North west of the Service Hub
Hungry WorkersConsumables x2FarmDrilling site
Across the riverCurtainside trailerDrilling SiteSherman IslandOffroad truck is recommended
Solid foundationConcrete slabs x1Warehouse or Drilling siteNorton’s House in North-West cornerTruck with crane is recommended to pick up at Drilling Site
Threatening AccidentFuel Station at EastTruck with crane is recommended
Smithville BridgeWooden planks x2Dam
Unlucky FishermanChevrolet CK1500East of the QuarryFisherman’s House
Winter StoresMaintenance trailer,

Vehicle Spare Parts 2x
Logistics BaseThe Maintenance Trailer is on the Black River drilling site; if it isn’t, you can always restart the contract and it will spawn there. The correct trailer is marked with the magnifier icon.


It needs at least 201 L fuel in it. You need to have the trailer attached or winched to the truck with both the truck and trailer inside the zone for it to count.

The Vehicle Spare Parts are on the flatbed trailer at the Drilling Site
ContractWhatFromToNotes
ContestWhatFromToNotes
Going UnderRescue a floating house

Drummond Island

LocationHasNeeds
Log StationWooden planks (1 unit)
Long logs (1 long log unit)
Close to South Fuel StationLarge concrete pieces on sideboard trailer
TaskWhatFromToNotes
Cousin CletusOil barrels x2Lighthouse KeeperBring a heavy crane to pick up the first crate of barrels close to the Drummond Bridge.

The cliff above the barrels in the North-East is very high, so normally the cable of the crane cannot reach them. You need to hang the truck from the cliff. It looks like any truck and crane is fine as long as it is dangerously hanging above the void. Equipment examples: White Western Star 4964 with the yellow crane, Pacific P12 with the red Profcrane 320.
It looks like all rear or front wheels have to be in the air.

Once the barrels are on the cliff, you can pick them up with another truck.
Support local rangersWooden planks x2Log StationRanger’s Bridge
Tourist AttractionExplore Hollis IslandScout is recommended
Lost DeliverySpecial cargo x3?South-West Log stationTruck with crane recommended
Of bridges and menWooden planks x2Log StationIsland’s Bridge
Ten-HuntMetal beams x2,
Concrete slab x2
Drummond Bridge

Island Lake

TaskWhatFromToNotes
Hunter Bob’s BridgeWooden planks x4Log StationBob’s Bridge
No country for old truckRestore Western Star 6900 TwinSteerRepair it and fuel it up
Rusty LegacyChevrolet CK1500North-East Log StationFarmer’s houseOffroad truck is recommended
The huntsman and the carScout 800Center of the mapHunter’s ParkingOffroad truck is recommended
A little help for my frinedsReach 6 pointsScout recommended
ContestWhatFromToNotes
Flaming BarrelsOil barrels

Cannot build underground in Cities: Skylines editor

In Cities: Skylines the Page Up and Down buttons set the elevation of the road and rail line. In the editor the Page Down does not take you below ground with negative numbers.

To build underground in the Cities: Skylines editor subscribe to the Network Anarchy mod.

  • Enable Anarchy mode, and press the Page Down button to set the negative elevation

Water required error message in Cities: Skylines

When we try to create an outside ship connection and the waterway is not deep enough, we get the

Water required

error message.

To be able to create the outside ship connection, temporarily raise the sea level. It will flood your map, but after creating the connection you can lower the sea level, and the water will evaporate.

  • In the menu select the Water tool and click the Move Sea Level icon,
  • On the left side write down the current sea level, and move the slider to raise it,
  • Wait until the sea floods the area of the planned connection,
  • Make the outside ship connection,
  • Set the sea level back to the original value.